Mort-lemur Posted April 16, 2014 Share Posted April 16, 2014 Hi, In my 2.3.3.4 set up shops I have a product that can only be sold in pallets of 50 Bags of products. However, the bags of products may be mixed in the total 50 quantity. The bags cannot be sold as individual items. So I need a mod that allows me to sell a master product of 50 bags made up of, for instance: 10 Bags of product A 30 Bags of product B 7 Bags of product C 3 Bags of product D To complicate things even more each type of bag has a different price, and the pallet MUST contain 50 bags (1 Tonne) I dont think the Master products mod will quite allow this, but it is close - anyone have any ideas how best to achieve what I need? Many Thanks Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members. Link to comment Share on other sites More sharing options...
♥toyicebear Posted April 16, 2014 Share Posted April 16, 2014 As an alternative too using Master products for this, you could look at http://addons.oscommerce.com/info/3345 in combination with a min. qty per product. Basics for osC 2.2 Design - Basics for Design V2.3+ - Seo & Sef Url's - Meta Tags for Your osC Shop - Steps to prevent Fraud... - MS3 and Team News... - SEO, Meta Tags, SEF Urls and osCommerce - Commercial Support Inquiries - OSC 2.3+ How To To see what more i can do for you check out my profile [click here] Link to comment Share on other sites More sharing options...
burt Posted April 17, 2014 Share Posted April 17, 2014 Extension of Product Attributes along with a new "buy block" setting per product. Set "buy block" to 50 on a product called "Pallet of Bags", have options/attributes extension for A, B, C, D (along with price increase/decrease as appropriate). In shopping cart check that the total number of "Pallet of Bags" is divisible by the "buy block", if so allow checkout, if not popup an error message. Interesting concept. Link to comment Share on other sites More sharing options...
♥bruyndoncx Posted April 17, 2014 Share Posted April 17, 2014 I understand master products would work well for the layout / ordering of products while keeping track of stock of each kind of bag. But for the other requirements I was thinking more along the lines of a special shipping method where you define these conditions. Is palletshipping free with 50 bags and not with 45 bags ? no restrictions on destinations ? KEEP CALM AND CARRY ON I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support). So if you are still here ? What are you waiting for ?! Find the most frequent unique errors to fix: grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt Link to comment Share on other sites More sharing options...
Mort-lemur Posted April 17, 2014 Author Share Posted April 17, 2014 @@toyicebear - Looks interesting + a simple install which I like :) Ill take a look at that one later. @@burt - I have no Idea what you have just said ..... Remember Im a mere mortal @@bruyndoncx - The thing with master products that I can see is that the slaves have to be buyable products in their own right? To explain the situation a bit more - it is for 1 Tonne pallet loads of Livestock feed - but the customer can mix the feed within that 1 Tonne load, between different protien levels for Pigs, Cattle, Sheep, Chickens etc so the pallet could be made up of : 10 Bags of Pig Grower 20% Protien 30 Bags of Lamb Pellets 20% Protien 7 Bags of Layers Pellets 18% protien 3 Bags of Ewe Nuts 18% protien delivery and the cost of the products is based on buying in 1 Tonne loads. Thanks Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members. Link to comment Share on other sites More sharing options...
burt Posted April 17, 2014 Share Posted April 17, 2014 @@burt - I have no Idea what you have just said ..... Remember Im a mere mortal Ok. In as simple terms as I can possibly make it; 1. Master Product 2. Slave products are options/attributes of the Master 3. Allow buyer to mix and match attributes, with a minimum buy of 50 attributes. and 4. On the master product, allow people to buy multiple attributes (slaves) at the same time inserting a quantity needed and then press the buy button. and 5. You could have the buy button only appear if the inputted quantities are divisible by 50. As I said, interesting concept. Link to comment Share on other sites More sharing options...
Mort-lemur Posted April 17, 2014 Author Share Posted April 17, 2014 @@toyicebear The Attribute Qty Product Info mod dates back to 2008 for its latest release and does not appear to work as written in my 2.3.3.4 set up - so have uninstalled. @@burt Thanks Gary for using smaller words for me :) I have tried installing the master products mod - but had to give up on admin/categories.php as my version of this file is modified with x-sell, Ultimate SEO URLs, Header Tags SEO, Exclude Free Shipping, Option Types V2, Cost / Margin Reporting and Ajax attribute manager. And even with using beyond compare I could not make the changes fit as they should...... Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members. Link to comment Share on other sites More sharing options...
♥toyicebear Posted April 17, 2014 Share Posted April 17, 2014 Did a quick test of the attribute mod on a 2.3.3.4 shop, and with a few adjustments it seemed to work ok in the sense that the attributes are listed as text with a quantity box and you can add in individual quantity for different attributes and then press the "add to cart" button. As it stands it might not be the ideal way especially if you use options/attributes for other products since it would be in effect for all of those too. But I could be used as a base and made selectable on a per product basis. Basics for osC 2.2 Design - Basics for Design V2.3+ - Seo & Sef Url's - Meta Tags for Your osC Shop - Steps to prevent Fraud... - MS3 and Team News... - SEO, Meta Tags, SEF Urls and osCommerce - Commercial Support Inquiries - OSC 2.3+ How To To see what more i can do for you check out my profile [click here] Link to comment Share on other sites More sharing options...
Mort-lemur Posted April 18, 2014 Author Share Posted April 18, 2014 @@toyicebear Thanks, Tried it again, and I can get the attributes listed below each other, and remove the drop down boxes - but no quantity selection box or price is displayed. Maybe its something to do with the changes to my product_info.php Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members. Link to comment Share on other sites More sharing options...
♥joli1811 Posted April 18, 2014 Share Posted April 18, 2014 @@Mort-lemur Hi got working but still bugs for some reason in the admin if the Products Attributes Value Price is 0 the attribute does not appear if I make +1.00 then everything is ok plus the calculation I think just a small bit of code missing as I had to modify a bit to get to work with options v2 maybe a work around making the product price zero and each attribute has a full price just of the top of my head . Added $ProdOpt_Comment to the code as they were missing. Of course the problem is it affects all the drop downs in the shop Now I have not really tested so is really rough but maybe a starting point -->link to demo If you test I have a quantity box on the product info set as default to x 1 so has to be changed to zero or there will be an extra item added to cart (51) If you want the product_info.php to compare I can upload mine is a bit modified as it is a test shop so best is just to merge the code. Regards Joli To improve is to change; to be perfect is to change often. Link to comment Share on other sites More sharing options...
Mort-lemur Posted April 18, 2014 Author Share Posted April 18, 2014 @@joli1811 That looks great!! sent you a pm asking for sight of the file. It will be a problem losing the product dropdowns throughout the store - I think it will probably need a new field somewhere to turn it on or off on a product with some if - else statements very similar to exclude free shipping. Thanks Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members. Link to comment Share on other sites More sharing options...
♥joli1811 Posted April 18, 2014 Share Posted April 18, 2014 Hi, File attached I think it is this block of code that is causing the problem with the admin values having to be plus x 1.0000 $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; if ($products_options['price_prefix'] == '+') { $price_with_attribute = ($product_info['products_price'] + $products_options['options_values_price']); Just having another look not really sure Regards Joli product_info.php To improve is to change; to be perfect is to change often. Link to comment Share on other sites More sharing options...
♥joli1811 Posted April 18, 2014 Share Posted April 18, 2014 @@joli1811 That looks great!! sent you a pm asking for sight of the file. It will be a problem losing the product dropdowns throughout the store - I think it will probably need a new field somewhere to turn it on or off on a product with some if - else statements very similar to exclude free shipping. Thanks Yes that would be nice I am just updating the options type for 2.3.3.4 with new install instructions so if you do get any nice code let me know so I can include in the new package also what Burt was saying "You could have the buy button only appear if the inputted quantities are divisible by 50." would be great could maybe attach to the product ID To improve is to change; to be perfect is to change often. Link to comment Share on other sites More sharing options...
MrPhil Posted April 18, 2014 Share Posted April 18, 2014 Rather than Master Products or Product Attributes, why not just sell it by the bag, but require the total quantity to be a multiple of 50 bags? Reject the order at checkout if it doesn't meet this criteria (with an appropriate message). I would think that adding a small amount of extra code in checkout to look for a certain class of products, and adding up their quantities, might be an easier approach. Of course, it would be even better to have a nice clean admin interface to specify which products are in this class, and what the total quantity minimum/maximum/multiple-of would be (default 1/unlimited/1), but maybe someone can come up with that. For now, the message reminding customers that the total number of bags must be 50n would be hard coded into each product description, but with the proper administrative interface, it could be automatically added on the product information page. Would that be useful for other store owners? Link to comment Share on other sites More sharing options...
♥joli1811 Posted April 18, 2014 Share Posted April 18, 2014 seems there is a work around for the Products Attributes Value Price is 0 either insert a value of 0.001 or change // if ($products_options['options_values_price'] != '0') { if ($products_options['options_values_price'] != '0.005') { another fix not tested Open product_info.php Around line 150 find and delete: if ($products_options['options_values_price'] != '0') Note: Do not delete the { at the end of the line. Question is needs testing to see what effect it has on the other option types can not see any problems except for the missing dropdown To improve is to change; to be perfect is to change often. Link to comment Share on other sites More sharing options...
Mort-lemur Posted April 18, 2014 Author Share Posted April 18, 2014 @@joli1811 Thank You - Looking good so far, have been changing the layout slightly, just need to sort the indentation when the price goes to another digit - eg £9.00 to £10.00 as you will see in the screenshot below from my test setup. Next will be to try to only call this up when selected for a certain product(s) and have the usual dropdown selections for others. Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members. Link to comment Share on other sites More sharing options...
Mort-lemur Posted April 18, 2014 Author Share Posted April 18, 2014 OK next step - added an extra field to the product entry field with a default value of 0 - next bit will be to attempt to call up the multi attributes when this field is set to >0 for a product. Screenshot of new field below (traffic lights would have looked better - but this will do for now) Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members. Link to comment Share on other sites More sharing options...
♥toyicebear Posted April 19, 2014 Share Posted April 19, 2014 @@toyicebear Thanks, Tried it again, and I can get the attributes listed below each other, and remove the drop down boxes - but no quantity selection box or price is displayed. Maybe its something to do with the changes to my product_info.php Its because the code is placed within the code checking for attribute price, by reorganizing the code a bit it will pick up both those which have added price and those who don't. Checking for qty, you can do via javascript on the product info page and/or via php when they add the selection to the cart and if less than 50 then redirect them to the product info page with an appropriate message. Basics for osC 2.2 Design - Basics for Design V2.3+ - Seo & Sef Url's - Meta Tags for Your osC Shop - Steps to prevent Fraud... - MS3 and Team News... - SEO, Meta Tags, SEF Urls and osCommerce - Commercial Support Inquiries - OSC 2.3+ How To To see what more i can do for you check out my profile [click here] Link to comment Share on other sites More sharing options...
Mort-lemur Posted April 19, 2014 Author Share Posted April 19, 2014 Seem to be struggling with this :( I have created the new field in admin and the column in the database, and I have checked that it is being populated. I have defined the column name in database tables and I have included the table in the database query, but the if else as i have written it does not seem to work. I have used a format as below: <?php // BOF Option Types v2 added , 'post', 'enctype="multipart/form-data"' if ($products ['products_mult'] == '0') { echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product'), 'post', 'enctype="multipart/form-data"'); // EOF Option Types v2 } else { echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_mult'), 'post', 'onsubmit="return ray.ajax()" enctype="multipart/form-data"'); } ?> where have I gone wrong? Thanks Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members. Link to comment Share on other sites More sharing options...
♥toyicebear Posted April 19, 2014 Share Posted April 19, 2014 as a first if you have included it in the standard product info query then it would be $product_info['products_mult'] Basics for osC 2.2 Design - Basics for Design V2.3+ - Seo & Sef Url's - Meta Tags for Your osC Shop - Steps to prevent Fraud... - MS3 and Team News... - SEO, Meta Tags, SEF Urls and osCommerce - Commercial Support Inquiries - OSC 2.3+ How To To see what more i can do for you check out my profile [click here] Link to comment Share on other sites More sharing options...
Mort-lemur Posted April 19, 2014 Author Share Posted April 19, 2014 @@toyicebear Thanks Nick, I was calling up the table rather than the table query..... - just one step away from getting this working now - but again struggling with a bit of code as follows: if ($product_info['products_mult'] == '0') { if ($products_options['price_prefix'] == '+') { $price_with_attribute = ($product_info['products_price'] + $products_options['options_values_price']); } else { $price_with_attribute = ($product_info['products_price'] - $products_options['options_values_price']); } ?> <tr> <td class="main" align="center"> <?php echo $products_options['']; echo tep_draw_hidden_field('a[]', $products_options['products_options_values_id']); echo tep_draw_hidden_field('b[]',$products_options_name['products_options_id']); ?> </td> <td class="main" align="center"> <?php /* uncomment if you want to show the model number echo $product_info['products_model']; */ ?> </td> <td class="main" align="center"> <?php echo $currencies->display_price($price_with_attribute, tep_get_tax_rate($product_info['products_tax_class_id'])); ?></td> <td class="main" align="center"> <?php echo tep_draw_input_field('quantity[]',$value = '0',"size=2");?></td> <td class="main" align="center"><?php echo $ProdOpt_Comment . ':'; ?><br></td> </tr> <?php $x++; } } else { } } if (is_string($HTTP_GET_VARS['products_id']) && isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]; } else { $selected_attribute = false; } if ($product_info['products_mult'] == '0') { // BOF Option types v2: Change layout of drop down ?> <div class="clear"></div> <div class="option select"> <div class="name"><?php echo $products_options_name['products_options_name'] . ' :' ; ?></div> <div class="Desc"><?php echo $longDesc; ?></div> <div class="comment"><?php echo $ProdOpt_Comment ; ?></div> <div class="content"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></div> </div> <?php } // EOF Option types v2: Change ;layout of drop down Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members. Link to comment Share on other sites More sharing options...
Mort-lemur Posted April 19, 2014 Author Share Posted April 19, 2014 Ok almost there - couple of screenshots below - one is with new field set to 0 which gives the default behaviour, the other is with the field set to 1 which gives the qty selection boxes. Need to test some more but looking good so far. Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members. Link to comment Share on other sites More sharing options...
♥joli1811 Posted April 19, 2014 Share Posted April 19, 2014 @@Mort-lemur :thumbsup: Looking good maybe change the tables to divs eventually but that is minor do you see a problem where the first original dropdown has x 1 dropdown as expected but the 2nd dropdown has the x 2 dropdown and the 3rd dropdown has x 3 dropdowns maybe your if / else code has solved this? To improve is to change; to be perfect is to change often. Link to comment Share on other sites More sharing options...
Mort-lemur Posted April 19, 2014 Author Share Posted April 19, 2014 @@joli1811 cant see a problem with this - sent you a pm with a link to my development store Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members. Link to comment Share on other sites More sharing options...
♥joli1811 Posted April 19, 2014 Share Posted April 19, 2014 See no problem your recoding has solved the issue I had. Regards Joli To improve is to change; to be perfect is to change often. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.