![]() |
Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
I needed the ability to offer some items in "case quantities" (ie. 12, 24, 36, etc). This thread (http://forum.x-cart.com/viewtopic.php?t=23097) describes how to do this site-wide, but I also have items which are sold in single units. Here's what I did: (This has been edited to resolve the Variant Qty problem described in the posts below. GF) (I've edited the code again to patch another javascript issue - argh.)
That's it! Items that don't have a CaseSize set will behave normally, stepping by 1. Notes: If you allow customers to update item quantities in the cart, they will be able to change their quantities to non case quantity multiples. Items using CaseSize will not benefit from X-cart's built-in inventory javascript. This was done in x-cart gold 4.0.13. happy modding, Glen |
I've updated the code above to fix a problem with the quantity listing when showing case quanitities. The javascript on product.tpl also controls the quantity select menu and this needed to be edited to match how the Section loop behaved.
-Glen |
Hello Glen
I installed this mod and it works great except for the "step" option in the dropdown box. I have it set up to step by 10 up to 500 which it does, but after the 500 in the dropdown box it goes to 60, 61, 62, ect.. up to 500 Example of options in drop down box: 480 490 500 60 61 62 Any idea what may be causing this? Thanks |
I also found out I only have this problem if the product has a variant.
|
Tony -
I've edited the original code above to fix the problem you found. Items with Variants and CaseSize should now display a proper Quantity selection pulldown. Thanks for spotting that. -Glen |
Quote:
Thanks alot Glen I'll give it try. Really apreciate you taking the time to check this out. Tony |
That did the trick Glen.
Thanks again Tony |
I've updated the code again with hopefully the last fix. Today's previous update disabled the "add to cart" button (whoops). The new fix applies to modules/product_options/check_options.tpl and turns off some javascript if the item has case quantities.
-Glen |
Thanks Glen,
I turned in a ticket on this to see if there is a way of doing this without losing X-cart's built-in inventory javascript. Thanks Tony |
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
Thanks so much for the code. Works a treat.
|
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
I need something very similar to this. If I have the min. order amount set to 2 I need the quantity to increment by 2s.
Any help with modifying this? |
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
I have this code running on my site I can sell it for $35. I have also PM you the link for demo.
Thanks |
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
Hi
I started making this mod to my cart (4.1.5) but had to stop at the step where you modify the javascript. It looks like it has been moved and substantially changed in 4.1. Has anyone gotten this to work in their cart? Thanks |
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
I am running X-Cart version 4.1.6.
I was following gfiebich's instrusctions until I came to: "6. Open modules/Product_Options/check_options.tpl and find..." The code section mentioned is missing from check_options.tpl in the version of X-Cart that I'm running. Can anyone post a modification for version 4.1.6 please? Thanks |
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
Seamless. Worked well.
Now, how can I pass that same variable to the buy_now.tpl so it displays the same quantity drop down on the products pages. Right now in buy_now.tpl, I just have: {section name=quantity loop=$mq start=$start_quantity step=12} But I'd like to get it to pass the CaseSize variable instead of having it hard-coded. Just not sure what i need to do to make $case_size usable in that spot. |
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
Quote:
Looks like all of the steps work fine for 4.1 and you can skip step 6. It doesn't appear to be needed but I may be missing something. :) |
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
Quote:
This may be difficult with 4.0 since Extra Fields are not available in the product listings. However, they are available in 4.1. :) |
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
Quote:
Hey I had just started working on a module like this until I found this thread. I had the same problem though when I hit the last step until I looked at the bottom of the page and noticed that they have just seperated the java from the rest of the code. So the last step for 4.1.8 (maybe the whole 4.1.x branch) should be 6. Open modules/Product_Options/func.js and find Code:
if (!availObj) and replace it with Code:
if (case_size == '') { I've gotten this working fine (I think) with dynamic images too so if you have questions about doing it with that program feel free to ask me and I'll try to help you through. I need to confess though that I don't know javascript though so if anyone can confirm what I've done here I'd love to know I'm not screwing things up :p Also I think these forums should setup some way to monetarily thank people for awesome modules like this! I know people are just sharing some knowledge which is really really awesome, but I'd love it if I could give a few bucks at least to thank people like gfiebich for saving me tons of time :) |
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
I'm also working on a modification to this so that i can specify minimum quantities for wholesale customers only. So for example I have bookmarks that a normal customer can buy 1 at a time but wholesale need to buy at least 6. I'll update with any progress I make with this.
|
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
Alright, now again please realize I've only been working with PHP for a little bit here and everything I know I've taught myself. So if anyone good could make sure I'm not screwing stuff up that would be great.
Anyway my problem as I listed in my last post is that I needed certain products such as bookmarks to be purchased in certain quantities by wholesale members while regular users needed to be able to purchase whatever amount they wanted. We start with what gfiebich posted but with my modifications for the 4.1.8 ver (maybe the whole 4.1.x branch).
To add in the functionality so that certain products such as bookmarks to be purchased in certain quantities by wholesale members while regular users needed to be able to purchase whatever amount they wanted.
This isn't fully finished. I'd like to change the starting # from "0" to something I have defined in an extra field. I'm sort of figuring out how to do this. |
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
Alright, realized in another thread most people probably have account stuff setup differently then I do which makes it easy for me to do this. We don't allow most people to create an account, they can signup for mailers and post on our blog. We do have wholesale accounts which we create and then they are able to login and that is the only way they can get prices for that.
So the problem is if you can have regular accounts, a wholesale or whoever can go in as a logged out person, select under the min quantity and then log in which makes it so they can get the savings without quantities. This can be fixed but it's not something we have to deal with. |
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
Well unfortunatly this doesn't work with xcart 4.1.10 anyone know how to make it successfully work in this version?
|
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
i would love to know aswell
the part u need to replace in the Check_options.tpl doesnt exist. |
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
also... is it possible to tweak this to make the case options not a multiple of that vale, but a list of quantities,
eg, 2, 10, 20, 50, 100 |
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
I took would like it to be able to input specific quantites, not multiples. Any suggestions?
|
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
Quote:
I'd like to know as well... :roll: Anyone got this mod working with a recent version? |
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
Never mind, I got it working!!! Just skipped step 5 and used the renewed code change in step 6. :) :) :)
|
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
Quote:
:( Well, I guess I expressed my joy to early. I discovered a problem with all my products with a variant (size) The size option drop down box now appears twice on top of each other. I restored the product.tpl and func.js files back to prevent customers from frowning... Does anyone know how to solve this? Thanks in advance! |
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
Hello, well guess again. I got everything working correctly now. It seemed I missed post #20 ( http://forum.x-cart.com/showpost.php?p=214440&postcount=20 ) and just implemented the code from all 6 steps and.. voila! Just the exact mod I need and with my variants also working :)
|
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
Quote:
I'm upgrading from 4.1.8 soon so this was good information, thanks :) |
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
Good Morning,
This mod is just what I am looking for but it looks like there are some changes from 4.1.8 to 4.2.1 Has anyone implemented this change on their 4.2.1 version or have a similar mod? TIA, Angie |
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
I have just done this mod in 4.3 and works a treat. I only added the extra pieces of code and didnt copy and paste the whole bit of each. The work round for step 6 still needs to be done with changes. Shout if anyone needs to know how I did this. Cheers to the guy who came up with this.
|
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
I need to know how to do this in 4.3, can you post it? Thanks!
|
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
This would save a whole lot of trouble
BUMP |
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
I need to custiomized the product options to serve a special task in my website.
I want to create a Drop down list which is normal and available now on website for ex: Size:(1,2,3,4,5, Customize) I will create different Text options too like: Hips, Arm, Waist, Bust as test field to options products. If customer selected "customize" from drop down list dynamicaly the Test fields above should be displayed below it. or then they should be hidden all time unless customer picked Customize from Size drop down list. Please advice what change required to reach this option Regards |
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
I am in need of this mod for 4.4.4. The changes from 4.1 to 4.4 are significant but I've been trying to go line by line to try and figure it out. In the meantime, I've been getting quotes from X-Cart Support and BCS to write the mod. Unfortunately I don't have the budget for them. Please...if you have this working on your 4.4 site and can share the changes, I would be indebted...
Thanks. |
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown - UPDATED FOR 4.4.4
I have just successfully got this to work on 4.4.4 and also work on the product categories pages. Kudos to gfiebich for the original mod.
|
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
philrisk
Thank you very much for your detailed instructions. Everything was spot on except for the very first change box on product_details.tpl. The file in my template skin (fashion mosaic gray) and the one in the common_files directory are very different from the example you gave. There is a ton of code within the first if statement. I even checked the product_details.tpl in 2-columns to see if they matched your example and they did not. I made an attempt to stitch in the unique extra_case code in product_details.tpl, as well as all the other changes. The Case Size extra field displays in the product admin and I updated a few products, but when I go to the storefront, the quantity box is still a text box, that any number can be entered into. Is it supposed to be a dropdown? Any light you can shed on the situation would be most appreciated. Thank you for all you've done already. |
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
Quote:
Hi pwdesign That piece of code is at line 75 of /skin/2-column/customer/main/product_details.tpl in a default install of 4.4.4. It is right after: {if $active_modules.Feature_Comparison} {include file="modules/Feature_Comparison/product.tpl"} {/if} To get the dropdown for the quantities you need to make sure you have "Show quantity selector as input textbox" unchecked in the Appearance settings. |
Re: Case Quantities (ie. 12, 24, 36, etc) in quantity pulldown
OK..I see it now. Thanks! Fashion Mosaic has a very different product_details.tpl. I stitched in the code where I thought it should go, unchecked the Text Box option in Appearance and IT WORKS! Thank you!
However...once the item is added to the cart, the quantity field is a text box again and can be changed to any amount. I unchecked "Allow to update product quantity on the checkout pages" in Apperance and it still shows. Is yours like that as well or do you have a dropdown menu in the cart or no quantity update at all? Thank you very much! |
All times are GMT -8. The time now is 03:56 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.