bekatron Posted October 4, 2008 Posted October 4, 2008 Hello, At my suplyer some products are in a package. The complete database is set up also a field package for every product where the packageqty is in. Now i need a solution that says you kan buy 5 or 10 but not 6 or 11 when the field package is 5. Can please somone help me. I'm sorry for my bad english Regards Bas
♥geoffreywalton Posted October 4, 2008 Posted October 4, 2008 You could set up a product of say 25 x widgets" and then have product options with price increases for 10, 25, 20 etc or allow them to buy 2,3,4 etc packs of 5. Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile Virus Threat Scanner My Contributions Basic install answers. Click here for Contributions / Add Ons. UK your site. Site Move. Basic design info. For links mentioned in old answers that are no longer here follow this link Useful Threads. If this post was useful, click the Like This button over there ======>>>>>.
failsafe Posted October 4, 2008 Posted October 4, 2008 At my suplyer some products are in a package. The complete database is set up also a field package for every product where the packageqty is in. Now i need a solution that says you kan buy 5 or 10 but not 6 or 11 when the field package is 5. Can please somone help me. Hi Bas, (edit) Ha Geoffrey got there first, with the same solution, but here's my take with just a bit more flesh on the bones! :) I'm not too sure what you are trying to do. I think you are saying that your osCommerce database has been altered so that each product has an extra field called packageQty or suchlike, and that field contains an integer denoting how many items must be bought at the same time of each particular product. How about this solution to your problem instead, let's call it the supermarket method... :) Remove the extra field packageQty, multiply the price (per single item) by the original packageQty value (or put whatever price you want to charge for the multipack) and change the item title from, "Cool Beer 330ml" to "Cool Beer 330ml (4 Pack)", for example. Then you're back to just letting everyone buy single products at a time, but in the case of your packaged products they are actually buying a single '4 pack' rather than just 1 item from the pack. The supermarkets effectively create a new product (the package), and say something like 'items in this pack are not sold separately'. They re-label the multipack with a new barcode so it allows them to adjust the price of the multipack to be different than simply multiplying the price of an individual item by the pack size. They may or may not choose to sell individual items separately too. They might even have different sized multipacks, e.g. 6-pack, 24-pack. Further to this... say you have a product that you want to sell as a single, or a pack of 6, or a pack of 10, but not other quantities. You could set up attributes such that you offer 3 choices. Perhaps you would call the option list "Pack size" where the options are 1, 6 or 10 (in this example). You would associate different prices with each option, but all you would then have just one entry for the product in the database. In the case of the Beer example I used, you'd have the main product title remaining as "Cool Beer 330ml", and options being "Single, 0.00", "6-Pack, +5.00", "10-Pack, +8.00", say. I don't think you need a product option for 5, 10, 15, 20, 25,... etc. You can alter the number of items you want to buy in the shopping basket. So if your pack size is 5 say, and buying a single item means buying the 5-pack, obviously you can just buy 2 '5-pack' products. Good luck.
bekatron Posted October 4, 2008 Author Posted October 4, 2008 Thanks for your reactions but.. Al the products (15000) are automatic imported bij a cron program. So when i need to edit all the products that have this problem (about 4500) i've a much bigger problem then i have now. Is it not posible to let the cart look at the field package so it can put the qty automatic to the nearest qty available for example when orderd 14 let the card update to 15 and when orderd 11 update to 10? Regards Bas
failsafe Posted October 4, 2008 Posted October 4, 2008 Thanks for your reactions but.. Al the products (15000) are automatic imported bij a cron program. So when i need to edit all the products that have this problem (about 4500) i've a much bigger problem then i have now. Is it not posible to let the cart look at the field package so it can put the qty automatic to the nearest qty available for example when orderd 14 let the card update to 15 and when orderd 11 update to 10? Yes, possible, but not very friendly to the customer don't you think? What about when your customers try to buy 1 and the cart adjusts it to 5? Could you not write some code to adjust the product title to incorporate the pack size instead. So, say your packageQty value is 5 then you'd display the product title as "Cool Bier 330ml (Pack of 5)", where the ' (Pack of 5)' part is automatically added using the setting of packageQty? I don't know how your pricing is working in so far as what price you store in the database. Are you storing price for 1 item or price corresponding to productQty? If you're just storing the price for a single item then you would need to do a calculation to use the correct multiplied price (productQty * single item price) wherever the price is used and displayed. Perhaps this would solve your problem in a more friendly way?
bekatron Posted October 4, 2008 Author Posted October 4, 2008 Yes, possible, but not very friendly to the customer don't you think? What about when your customers try to buy 1 and the cart adjusts it to 5? Could you not write some code to adjust the product title to incorporate the pack size instead. So, say your packageQty value is 5 then you'd display the product title as "Cool Bier 330ml (Pack of 5)", where the ' (Pack of 5)' part is automatically added using the setting of packageQty? I don't know how your pricing is working in so far as what price you store in the database. Are you storing price for 1 item or price corresponding to productQty? If you're just storing the price for a single item then you would need to do a calculation to use the correct multiplied price (productQty * single item price) wherever the price is used and displayed. Perhaps this would solve your problem in a more friendly way? In the product info is the text This product is only be sold in parts of .. The cart wil set the qty automatic to the nearest qty you've entert. (where .. is the field packageqty. So the costumer is notice about this. But when there is a other number then that the cart must automatic chance that and give a notice that it is chance.
♥geoffreywalton Posted October 4, 2008 Posted October 4, 2008 How would you identify the 4500 products that can only be sold in multiples of 5? Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile Virus Threat Scanner My Contributions Basic install answers. Click here for Contributions / Add Ons. UK your site. Site Move. Basic design info. For links mentioned in old answers that are no longer here follow this link Useful Threads. If this post was useful, click the Like This button over there ======>>>>>.
bekatron Posted October 4, 2008 Author Posted October 4, 2008 I want to let the card look if the field packageqty is other then null and then let it multiply this by the qty in that field
failsafe Posted October 4, 2008 Posted October 4, 2008 In the product info is the text This product is only be sold in parts of .. The cart wil set the qty automatic to the nearest qty you've entert. (where .. is the field packageqty. So the costumer is notice about this. But when there is a other number then that the cart must automatic chance that and give a notice that it is chance. I'm getting confused now. OK, so: - the customer knows when he reads the small print in the description that he can only buy this product in a certain quantity. - Your osC database has been set up so that your `products` table contains an extra field called `products`.`productQty`, or something similar. - Each `productQty` value is set to null or a value depending on if the text "This product is only be sold in parts of" is contained in the product description? So why not simply alter the price in the database to reflect the price of the multipack and not mess about with altering the quantities of products that the person puts in their cart? A single item for such a product (i.e. one having a productQty set to something other than NULL) would then reflect the multipack with a a price appropriate for the multipack. Personally, I'd put something in the product title too (such as [Pack of 6] or whatever) like I suggested above, so that customers are not forced to read the product description to see that the product only comes in packs of X. Then when they see the product in the list of products they would understand the reason for the higher price is because it's a multipack rather than a single product. I'm sure you'll get to the solution you like in the end. Good luck.
bekatron Posted October 5, 2008 Author Posted October 5, 2008 Is there no simple solution for this to work?
failsafe Posted October 5, 2008 Posted October 5, 2008 Is there no simple solution for this to work? Strange... I thought I had offered the simplest solution! Oh well. Good luck. :)
bekatron Posted October 5, 2008 Author Posted October 5, 2008 Hello failsafe, The solution was ok when there are no 5000 products to edit. All the info of the products are in the database so when i must replace every product with a higher packageqty than 1 i need to completly edit my xml import programs. I've now ad a line in product info: //Minimum quantity code en lengte breedte en hoogte if (tep_not_null($product_info['products_package_qty']) && MINIMUM_ORDERS == 'true') { $products_name .= '<br><br><span class="smallText">Alleen te bestellen in partijen van: ' . $product_info['products_package_qty'] . ' stuks <br><span class="smallText">Lengte: ' . $product_info['products_length'] . '<br><span class="smallText">Breedte: ' . $product_info['products_width'] . '<br><span class="smallText">Hoogte: ' . $product_info['products_heigth'] . '</span>'; } //End: Minimum quantity code en lengte breedte en hoogte Now i need to write the code for multiplying.
failsafe Posted October 5, 2008 Posted October 5, 2008 Now you have got me confused. I thought you said above that the database already gets set up as you stated: that is, you have introduced the new packageQty field to the product table. Have you not actually done that? If you do have the packageQty field set up as you said, and this gets automatically set to the correct package quantity by your import program, then I don't see the problem. What are you saying you have to edit? Do you mean to edit manually? Surely not. :) My suggestion above assumes the editing gets done 'on the fly' by some extra code you place in osCommerce when product title and product price is shown or used, depending on the value of the packageQty, i.e. when it is not NULL. With that being the case, I can not see why it matters how many products you have, 10, 100, 1000, or 1000000. As I said above, I would personally alter the value of the price in the osCommerce database to reflect the price of the package quantity, so that you do not have to alter any osCommerce code to do manipulation of the price by multiplying, whatever. I think it would be easier to do this multiplication (automatically) when you import your database via the cron job and set the product_qty value and product price in the database. Heck, you could even automatically alter the product title at the same time so there are no code changes to make to osCommerce whatsoever! :) Perhaps if you want further help and suggestions with this you'll need to explain in more detail exactly what data you have, what fields you actually have in your osCommerce database (of interest to this problem), etc.
bekatron Posted October 5, 2008 Author Posted October 5, 2008 Ok now i'm confused :blink: The field packageqty exist on the database and being automaticly fild bij the xml import program. I hope i understand this right when i say that you ment to let the xml automaticly fil the price for 5 products so oscommerce see this as 1? I'm sorry if i don't get it my english is not so technical. regards Bas
failsafe Posted October 5, 2008 Posted October 5, 2008 Ok now i'm confused :blink: The field packageqty exist on the database and being automaticly fild bij the xml import program. I hope i understand this right when i say that you ment to let the xml automaticly fil the price for 5 products so oscommerce see this as 1? I'm sorry if i don't get it my english is not so technical. regards Bas Yes. Perhaps the easiest way is to change the XML import program so that it: - inserts packageqty in the database (though this will now not be used by osCommerce so why bother?) - alters the price of the product to that of 5 products (if packageqty is 5) - alters the title of the product to add something like "(pack of 5)" to the original title (so customers don't need to view description to find it out) Then osCommerce will see it as just 1 product again so you would not need to alter the osCommerce code at all any more. I do believe we are now tuned to the same frequency! :)
Recommended Posts
Archived
This topic is now archived and is closed to further replies.