Syler Posted May 3, 2015 Share Posted May 3, 2015 (edited) Hi Guys,Not sure if this is possible but would be an almost perfect shipping system if it is..For Cubecart V6.04Is there any ways to make the Shipping Per Category not defaulting/relying to 'Primary Category' for the shipping costs?But rather get the shipping costs from whichever category that has the shipping costs entered. Edited May 5, 2015 by Syler A solution has been found and is explained at the bottom. Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted May 3, 2015 Share Posted May 3, 2015 I'm pretty sure that's how it does work. It doesn't inherit. Quote Link to comment Share on other sites More sharing options...
Syler Posted May 3, 2015 Author Share Posted May 3, 2015 Hello Al,It's always nice to see you again.It only take the shipping value from whichever category that is ticked as 'Primary'.So if I have them like this for example:Category A (parent category) / Category B (sub-category) / Product01.htmlCategory A: Has shipping value.Category B: No shipping value, but is ticked as the 'Primary' category for Product01.Shipping cost for Product01 will be zero dollars cause Category B doesn't have any shipping value.It doesn't look at the shipping value in Category A (parent category) cause Category A is not marked as 'Primary'.My question is, can this be changed so it doesn't rely solely on 'Primary'?I'm not sure but I think the codes is along Line: 784-790 in classes/cart.classes.phpBut I don't know what to change. Quote Link to comment Share on other sites More sharing options...
Syler Posted May 3, 2015 Author Share Posted May 3, 2015 What I'm trying to achieve is combine shipping.Let's say the store is selling DVDs and the categories are laid out like this:Parent Category / Sub Category / product.html-------------------------------------------------------------Movies / Thriller / Title01.html / Title02.html / Action / Title03.html / Title04.html-------------------------------------------------------------And the shipping costs: Per Shipment = $5.00 and Per Item = $1.00The shipping costs need to be entered in parent category (Movies) and shouldn't be in sub-category (genre).Cause otherwise it will make buying 2 x DVD disc from category 'Thriller' cost $7.00 in shipping,but then buying (1 x DVD disc from category 'Thriller' + 1 x DVD disc from category 'Action') total to $12.00 shipping.Both are equals to 2 x DVD discs but the shipping costs doesn't make sense.Now, of course I can use category 'Movies' as primary category for all of the products and have them also in the 'Genre' categories at the same time, to sort them up.But then when the product page is viewed, the breadcrumb navigation will not show the Genre category (cause it's just an additional).Instead, it will show something like this: Movies/Title01.So now customers can't tell what Genre is 'Title01' belong to.I hope I'm not confusing.. Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 3, 2015 Share Posted May 3, 2015 I will make an experiment where I have some products assigned to the primary category I will call ShipRateA. However, ShipRateA will be hidden (not Status=0). I hope to see that the Per Category shipping calculator will use the hidden primary category shipping data. I also hope to see that having products assigned to a hidden (but not disabled) primary category will not cause it to not be shown where it needs to be shown, not will the breadcrumbs be incorrect (but I think the breadcrumbs will always start at the primary category, even if the product was found elsewhere).Be back shortly.I was also wanting to collect every category the product is associated with, then remove any category with no shipping data, then find the cheapest rate. Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 3, 2015 Share Posted May 3, 2015 Well, the breadcrumbs for the test product include the hidden category ShipRateA, even though the test product is associated with other additional categories, and clicking on the ShipRateA link will show you a page listing all the products associated with it.(What I would like to see is that the breadcrumbs show the first valid category path, when not possible to show the actual "viewed" category path.) Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 3, 2015 Share Posted May 3, 2015 On the other hand, as a customer, I would rather get a reasonable shipping price than be confused over what the breadcrumbs say.And if being confused over what the breadcrumbs say is serious enough an issue, I would just turn them off. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted May 3, 2015 Share Posted May 3, 2015 Could the Genre subcategory designation be added to the product listing itself? Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 3, 2015 Share Posted May 3, 2015 Not without an edit to the code. The only category-related variable in the $PRODUCT array is the primary cat_id.But first, one needs to know how one got to the View Product page.If a product has four categories associated with it (and one has to be the primary), that product will show up on any of those four View Category pages.Clicking the product item in the list on that particular View Category page, (the following is what I want as mentioned above) I would want: 1) the breadcrumbs to reflect the category that I just came from, and 2) an element in $PRODUCT that indicates both the primary category and the category that I just cam from, the cat_id and the cat_name.There are also the pseudo-categories: Sale Items and Search Results. I think the primary category - if it and all ancestors are not hidden - should then be used. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted May 3, 2015 Share Posted May 3, 2015 i see your point. I was thinking about leaving off the breadcrumb. But I suppose you could have a Horror Cowboy Movie. Quote Link to comment Share on other sites More sharing options...
Syler Posted May 3, 2015 Author Share Posted May 3, 2015 Hi bsmither and Dirty Butter,It's so nice to have you guys also joined in and looking into this issue.Sorry if I was sleeping for the last few hours. My last post was like at 3.00am Australia time, so even though I was very curious but I also need to snooze LOL.Alright, so regardless of the category is set to 'not visible', it will always shows up in the breadcrumb when the product is viewed if that category is the primary category for that product.Ideally, when selecting category for a product, there should be another radio button to tick, an option like 'GET SHIPPING RATE FROM' next to the PRIMARY | ADDITIONAL | CATEGORY NAME columns. And there you can see every categories that already have shipping rates assigned. So it's like, which category the product belongs to and where CubeCart should get shipping rates are independently off each other.Naturally, as you have set up a few categories with all different shipping rates, the next NEW products that you want to sell could probably use one of them.So..Back to the initial question, is it possible to do a little tweak to get CubeCart to also look beyond 'Primary' category when getting shipping value? Or.. Should I just remove the breadcrumb? Which as a customer, I do see breadcrumbs as an important thing of a website. Not only it gives information where the product is sitting but also ease with navigation.Hmm.. Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 3, 2015 Share Posted May 3, 2015 "Is it possible to do a little tweak to get CubeCart to also look beyond 'Primary' category when getting [a category-based] shipping value?"Maybe a not a little tweak, but certainly do-able. Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 3, 2015 Share Posted May 3, 2015 Quick questions:How many specific categories do you have and how many do you expect to have?Will you ever want to have CubeCart choose from among several "shipper categories", or will you stay with only allowing one? Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 3, 2015 Share Posted May 3, 2015 Hmm... I just realized that Chuggy's Additional Product Fields has already laid most of the ground work for the task of getting a product associated with a "shipper category". Probably just two or three hooks and it's done! Oh well. Quote Link to comment Share on other sites More sharing options...
Syler Posted May 4, 2015 Author Share Posted May 4, 2015 If the option that I suggested up there could be implement, that would be an awesome shipping solution as we have full control.OK, let's say we set up a few categories like;extrasmall @ Per Shipment = $2.00 and Per Item = $1.00small @ Per Shipment = $5.00 and Per Item = $2.00medium @ Per Shipment = $10.00 and Per Item = $3.00large @ Per Shipment = $15.00 and Per Item = $5.00From there we can always choose which one fits best for the next line of products that you may want to sell.As long as those categories is not visible to the customers and should only be used to assign shipping.Another example using the solution above:Customer is buying 1 x printer and the shipping is (large) $15.00+$5.00 = $20.00Also buying 2 x cartridges and the shipping is (extrasmall) $2.00+$1.00+$1.00 = $4.00Total shipping will be $24.00Totally agree that one most likely know how one got to the product page.We should be able to replicate the steps to get to the page again if we navigate it ourselves.But what happen if we got to the page by clicking the randomly displayed 'FEATURED PRODUCT'.Once we left the page, we don't know how to get back to it if we don't know where it belongs. Quote Link to comment Share on other sites More sharing options...
Syler Posted May 4, 2015 Author Share Posted May 4, 2015 We can achieve that if we can have CubeCart's Product category and Shipping category independently of each other.Shipping gets its value from whatever category we would like it to get.Product sits in wherever categories we want the product to belong to.Because of that, breadcrumb will show exactly how the product is categorised.And the birds will be singing and the world is beautiful HAHAHAHA.. (I must be stressed) LOL Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 4, 2015 Share Posted May 4, 2015 Ok, I have the code written (well, all of it that I think needs written), and have tested half of it.I'll test the other half later.Send me a PM with your email address and we will work through the code changes and you can test on your store -- if you are brave enough.Once we prove this works, I'll write up the instructions (and hopefully make a plugin out of it - but don't hold your breath) and post it on CubeCartForums.org. Quote Link to comment Share on other sites More sharing options...
Syler Posted May 4, 2015 Author Share Posted May 4, 2015 Cool.. I've PM you.Let's not hold the breath but cross the fingers Quote Link to comment Share on other sites More sharing options...
Syler Posted May 5, 2015 Author Share Posted May 5, 2015 For those who have read this post..With the assistance of others on this forum and a special BIG THANK YOU to bsmither, after further experiments with various shipping scenarios, I have come to realise that the Per_Category shipping module should serve my needs after all The way the 'Per_Category' module works, is that it considers there to be only ONE shipment regardless of there being two or more 'per shipment' rates from whichever categories presented to the cart. The Per_Category module will ONLY USE ONE of it and that is the one with the HIGHEST 'per shipment' rate.So for those who need a shipping module that can 'combine shipping' and not worrying about the size or weight but rather by pre-estimate in advance how much it should cost to send a particular item and at the same time can combine shipping with other items, I say this should be THE BEST method.And lastly, I got to say this..Thank you kindly to all the legends of this forum, a legend such as bsmither for all of his contributions of helping others like myself who don't know much in the world of programming. For that I salute you. Quote Link to comment Share on other sites More sharing options...
harrisorganic Posted May 5, 2015 Share Posted May 5, 2015 Syler, we said and thank you for the summary. Well worth the read. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.