100asa Posted January 15, 2006 Posted January 15, 2006 I've stup order totale as 99, and 2gether as 98. Try with this value! Amanda, let me know the change to have discount with tax. On this page http://www.100asa.it/10-anelli-aggiuntivi-...nio-p-1078.html discount (euro 6,50) is without tax And I also ask you is it's possible have discount in money and percentage togheter, as in the admin. Quote Skype: centoasa Skype: remigioruberto
boxtel Posted January 15, 2006 Author Posted January 15, 2006 I've stup order totale as 99, and 2gether as 98.Try with this value! Amanda, let me know the change to have discount with tax. On this page http://www.100asa.it/10-anelli-aggiuntivi-...nio-p-1078.html discount (euro 6,50) is without tax And I also ask you is it's possible have discount in money and percentage togheter, as in the admin. yes, see : empress-necklace-A-1052.html Quote Treasurer MFC
boxtel Posted January 15, 2006 Author Posted January 15, 2006 I've stup order totale as 99, and 2gether as 98.Try with this value! Amanda, let me know the change to have discount with tax. On this page http://www.100asa.it/10-anelli-aggiuntivi-...nio-p-1078.html discount (euro 6,50) is without tax And I also ask you is it's possible have discount in money and percentage togheter, as in the admin. see new version in contributions. Quote Treasurer MFC
100asa Posted January 15, 2006 Posted January 15, 2006 don't work! Quote Skype: centoasa Skype: remigioruberto
Guest Posted January 15, 2006 Posted January 15, 2006 Hi, guys. I've tried what you both suggested, renamed the files and sort order, but it still doesn't work. Very strange! The module is not required to have the 2gether shopping cart addon installed in order to work, right? Here's the url to a demo of the discount module in use on my website: Cyclelogical As you can see, everything works fine; Images of products work, prices are shown, both products added to cart, but the discount is not shown on the checkout confirmation page. I'll wait and see, perhaps someone else experiences similar problems and comes up with a solution. Cheers Endre Quote
Guest Posted January 15, 2006 Posted January 15, 2006 Hi, guys. I've tried what you both suggested, renamed the files and sort order, but it still doesn't work. Very strange! The module is not required to have the 2gether shopping cart addon installed in order to work, right? Here's the url to a demo of the discount module in use on my website: Cyclelogical As you can see, everything works fine; Images of products work, prices are shown, both products added to cart, but the discount is not shown on the checkout confirmation page. I'll wait and see, perhaps someone else experiences similar problems and comes up with a solution. Cheers Endre Quote
boxtel Posted January 15, 2006 Author Posted January 15, 2006 don't work! helpful Quote Treasurer MFC
boxtel Posted January 15, 2006 Author Posted January 15, 2006 helpful new version in contrib section Quote Treasurer MFC
100asa Posted January 15, 2006 Posted January 15, 2006 (edited) Sorry, but in ceckout_confirmation I can see the 2gether price without tax. It's wrong! also in ceckout_confirmation the 2gether price must be with tax, and the amount of tax (italian IVA) must be included with 2gether tax. Example: (italian tax is 20%) product price (include tax): ?120,00 shipping (include tax): ?8,40 tax (IVA): ?21,40 2gether discount (include):? 7,80 tax (with 2gether): 22,70 (21,40+1,30) suggestion: all is more simply if your contribution have tax class Edited January 15, 2006 by 100asa Quote Skype: centoasa Skype: remigioruberto
100asa Posted January 16, 2006 Posted January 16, 2006 Error in admin: Warning: main(/web/htdocs/www.100asa.it/home/includes/languages/italian/modules/order_total/ot_together.php): failed to open stream: No such file or directory in /web/htdocs/www.100asa.it/home/securecentoasa/modules.php on line 132 Warning: main(): Failed opening '/web/htdocs/www.100asa.it/home/includes/languages/italian/modules/order_total/ot_together.php' for inclusion (include_path='.:/usr/local/lib/php') in /web/htdocs/www.100asa.it/home/securecentoasa/modules.php on line 132 in includes/modues/order_total/ I've now: ot_together.php It's right? Quote Skype: centoasa Skype: remigioruberto
100asa Posted January 16, 2006 Posted January 16, 2006 in ceckout_confimation: Warning: order_total(includes/languages/italian/modules/order_total/ot_together.php): failed to open stream: No such file or directory in /web/htdocs/www.100asa.it/home/includes/classes/order_total.php on line 25 Warning: order_total(): Failed opening 'includes/languages/italian/modules/order_total/ot_together.php' for inclusion (include_path='.:/usr/local/lib/php') in /web/htdocs/www.100asa.it/home/includes/classes/order_total.php on line 25 Quote Skype: centoasa Skype: remigioruberto
boxtel Posted January 16, 2006 Author Posted January 16, 2006 in ceckout_confimation:Warning: order_total(includes/languages/italian/modules/order_total/ot_together.php): failed to open stream: No such file or directory in /web/htdocs/www.100asa.it/home/includes/classes/order_total.php on line 25 Warning: order_total(): Failed opening 'includes/languages/italian/modules/order_total/ot_together.php' for inclusion (include_path='.:/usr/local/lib/php') in /web/htdocs/www.100asa.it/home/includes/classes/order_total.php on line 25 http://www.oscommerce.com/community/contributions,3929 Quote Treasurer MFC
100asa Posted January 16, 2006 Posted January 16, 2006 (edited) The last request: the box with the link to a 2gether page, with all 2gether offer! (as in your website!) :-) Edited January 16, 2006 by 100asa Quote Skype: centoasa Skype: remigioruberto
100asa Posted January 16, 2006 Posted January 16, 2006 I've this filed (added by me many time ago,a nd more useful): products_cost To have products cost to view page of 2gether product: $product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, p.products_cost, from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "'"); after I add: $contents[] = array('text' => 'costo:' .$currencies->format($products_cost)); but I can see only ? 0.00 Why this? ps: It's possible to load a small image (48x48) like category image, instead to load great image and see it as small image? :D Quote Skype: centoasa Skype: remigioruberto
boxtel Posted January 17, 2006 Author Posted January 17, 2006 The last request: the box with the link to a 2gether page, with all 2gether offer! (as in your website!) :-) simple: create a new page or use an existing one and add : <?php $mtm= rand(); $tq = tep_db_query("select product_1_id from " . TABLE_2GETHER . " where status = 1 and discount > 0 order by rand($mtm) "); while ($tg = tep_db_fetch_array($tq)) { $together_id = $tg['product_1_id']; include(DIR_WS_MODULES . '2gether.php'); } ?> Quote Treasurer MFC
boxtel Posted January 17, 2006 Author Posted January 17, 2006 I've this filed (added by me many time ago,a nd more useful): products_cost To have products cost to view page of 2gether product: $product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, p.products_cost, from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "'"); after I add: $contents[] = array('text' => 'costo:' .$currencies->format($products_cost)); but I can see only ? 0.00 Why this? ps: It's possible to load a small image (48x48) like category image, instead to load great image and see it as small image? :D in admin or catalog ? Quote Treasurer MFC
boxtel Posted January 17, 2006 Author Posted January 17, 2006 simple: create a new page or use an existing one and add : <?php $mtm= rand(); $tq = tep_db_query("select product_1_id from " . TABLE_2GETHER . " where status = 1 and discount > 0 order by rand($mtm) "); while ($tg = tep_db_fetch_array($tq)) { $together_id = $tg['product_1_id']; include(DIR_WS_MODULES . '2gether.php'); } ?> make sure you add this to the top of that page: require(DIR_WS_LANGUAGES . $language . '/offers.php'); Quote Treasurer MFC
100asa Posted January 17, 2006 Posted January 17, 2006 in admin or catalog ? in admin, when I see the 2gether products Quote Skype: centoasa Skype: remigioruberto
jenso Posted January 20, 2006 Posted January 20, 2006 Nice contribution and nice job, thanks I have an issue with getting the 2 products to show in the shopping cart. I did follow Post 9 and Post 15 Still it is not working how it should. It always only add the right product (product_B) to the shopping cart, the first product is never added. I had a close look at application.php file and found that there is where a fix has to be done. On my product_info.php the customer can choose the quantity of the product. To be able to do it, I change the code in application top from $_POST['id']))+1 to $_POST['id']))+$quantity case 'add_product' : if (isset($_POST['products_id']) && is_numeric($_POST['products_id'])) { if (tep_get_products_stock($_POST['products_id']) > 0) $cart->add_cart($_POST['products_id'], $cart->get_quantity(tep_get_uprid($_POST['products_id'], $_POST['id']))+$quantity, $_POST['id']); } if (isset($_POST['buy_tinn_add']) && is_numeric($_POST['buy_tinn_add'])) { if (tep_get_products_stock($_POST['buy_tinn_add']) > 0) { $cart->add_cart($_POST['buy_tinn_add'], $cart->get_quantity(tep_get_uprid($_POST['buy_tinn_add'], $_POST['id']))+1, $_POST['id']); } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; Due to this change the product_a is not added to the shipping cart. When you remove the change and replace $quantity with 1 the contribution does add both products. So now my question: How do I get the contribution to work correct and to be able to transfer the quantity input from the product/info.php to shipping cart? Any ideas??? Thanks Rich Quote
boxtel Posted January 21, 2006 Author Posted January 21, 2006 Nice contribution and nice job, thanks I have an issue with getting the 2 products to show in the shopping cart. I did follow Post 9 and Post 15 Still it is not working how it should. It always only add the right product (product_B) to the shopping cart, the first product is never added. I had a close look at application.php file and found that there is where a fix has to be done. On my product_info.php the customer can choose the quantity of the product. To be able to do it, I change the code in application top from $_POST['id']))+1 to $_POST['id']))+$quantity Due to this change the product_a is not added to the shipping cart. When you remove the change and replace $quantity with 1 the contribution does add both products. So now my question: How do I get the contribution to work correct and to be able to transfer the quantity input from the product/info.php to shipping cart? Any ideas??? Thanks quantity should not matter, my guess is that the stock of product a is zero. for adding regardless of stock level try : case 'add_product' : if (isset($_POST['products_id']) && is_numeric($_POST['products_id'])) { $cart->add_cart($_POST['products_id'], $cart->get_quantity(tep_get_uprid($_POST['products_id'], $_POST['id']))+$quantity, $_POST['id']); } if (isset($_POST['buy_tinn_add']) && is_numeric($_POST['buy_tinn_add'])) { $cart->add_cart($_POST['buy_tinn_add'], $cart->get_quantity(tep_get_uprid($_POST['buy_tinn_add'], $_POST['id']))+1, $_POST['id']); } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; Rich Quote Treasurer MFC
jenso Posted January 21, 2006 Posted January 21, 2006 Hi amanda (boxtel) thanks for the respond. Sorry, but I have to disagree with you, but it is not because the stock is zero. Because when I change >get_quantity(tep_get_uprid($_POST['products_id'], $_POST['id']))+$quantity, $_POST['id']); to >get_quantity(tep_get_uprid($_POST['products_id'], $_POST['id']))+1, $_POST['id']); ( Noticed, I have only replaced the "$quantity" with "1" ) than 2gether is working as it should, - both products are added to the shopping cart. So when I use the first quoted code of line: the quantity is added correct to the shopping cart quantity box, BUT products_a is not added to the cart When I use the 2nd quoted code of line: No quantity higher than 1 is showing in shopping_cart.php (no transfer of from product_info to shopping_cart) BUT both products from 2gether on product_info.php are showing in shopping cart. There must be a problem in application.php, but I do not have a clue on how to fix it, so it is working as I would like to have it. Any help or idea from anybody... Cheers Rich Quote
boxtel Posted January 21, 2006 Author Posted January 21, 2006 Hi amanda (boxtel) thanks for the respond. Sorry, but I have to disagree with you, but it is not because the stock is zero. Because when I change to ( Noticed, I have only replaced the "$quantity" with "1" ) than 2gether is working as it should, - both products are added to the shopping cart. So when I use the first quoted code of line: the quantity is added correct to the shopping cart quantity box, BUT products_a is not added to the cart When I use the 2nd quoted code of line: No quantity higher than 1 is showing in shopping_cart.php (no transfer of from product_info to shopping_cart) BUT both products from 2gether on product_info.php are showing in shopping cart. There must be a problem in application.php, but I do not have a clue on how to fix it, so it is working as I would like to have it. Any help or idea from anybody... Cheers Rich ah right, well, the 2gether box has its own form and the variable $quantity is not part of that as it has no quantity input field like your normal add to basket form has. so I would use echo tep_draw_hidden_field('quantity',1); inside the 2gether form so that the form contains the quantity variable with value 1. Quote Treasurer MFC
jenso Posted January 21, 2006 Posted January 21, 2006 ah right, well, the 2gether box has its own form and the variable $quantity is not part of that as it has no quantity input field like your normal add to basket form has. so I would use echo tep_draw_hidden_field('quantity',1); inside the 2gether form so that the form contains the quantity variable with value 1. yes!!, thanks that little code made it. :lol: For all the others who have a quantity input on the product page (product_info.php), make the change in .../includes/modules/2gether.php around line 104 find this code: echo tep_draw_hidden_field('products_id', $product_a['products_id']) . tep_draw_hidden_field('buy_tinn_add', $product_b['products_id']) . tep_image_submit('button_buy_now.gif', IMAGE_BUTTON_BUY2GETHER); add the tep_draw_hidden_field('quantity',1) so it will look like that: echo tep_draw_hidden_field('products_id', $product_a['products_id']) . tep_draw_hidden_field('quantity',1) . tep_draw_hidden_field('buy_tinn_add', $product_b['products_id']) . tep_image_submit('button_buy_now.gif', IMAGE_BUTTON_BUY2GETHER); thanks again for this nice contribution. Quote
Guest Posted January 21, 2006 Posted January 21, 2006 yes!!, thanks that little code made it. :lol: For all the others who have a quantity input on the product page (product_info.php), make the change in .../includes/modules/2gether.php around line 104 find this code: add the tep_draw_hidden_field('quantity',1) so it will look like that: thanks again for this nice contribution. Doesn't work I'm afraid. Are you sure the change is in the 2gether.php and not in the product_info.php? Cheers Endre Quote
jenso Posted January 22, 2006 Posted January 22, 2006 Doesn't work I'm afraid. Are you sure the change is in the 2gether.php and not in the product_info.php? Cheers Endre Do you have an input field for quantity on your product_info.php? something like this: <td align="right" nowrap style="padding-top:6px" class="smallText">Quantity: <input type="text" name="quantity" value="1" maxlength="3" size="2" style="font-size:9pt;font-family:Verdana;color:black;"> </td> if you do not have it, the above solution (post #69 to 73) is not for you. I did add quantity input on my product_info.php. I made a change in application_top.php and in product_info.php to make it work. Now that I add 2gether contribution, I had a problem to make it work for me. Thanks to amanda, who gave me the missing code it is running as it should. so if you want to have quantity input on your product_info.php you have to do the following: add this code somewhere before or inbetween the <form> and </form> (sorry can not tell you the exact line since I changed my product_info.php a lot, but it has to be before the "add to cart" button): <td align="right" nowrap style="padding-top:6px" class="smallText">Quantity: <input type="text" name="quantity" value="1" maxlength="3" size="2" style="font-size:9pt;font-family:Verdana;color:black;"> </td> than in application_top.php change the case 'add_product' to: // add quantity in product_info.php changed "+1" to "+$quantity" case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) { $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+$quantity, $HTTP_POST_VARS['id']); } So now your customer can input the quantity on your product_info.php and the quantity will show up in shopping_cart.php. To make it work together with 2gether contribution you have to change the above code to the following OR If you have already 2gether contribution installed than it should look like the following: NOTE: it makes no difference if you use "$HTTP_POST_VARS" or like amanda did "$POST". I just use "$HTTP_POST_VARS" because all the other code in application_top.php has it as well. NOTE2: The difference in the code is in bold. case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) { if (tep_get_products_stock($HTTP_POST_VARS['products_id']) > 0) $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+$HTTP_POST_VARS['quantity'], $HTTP_POST_VARS['id']); } if (isset($HTTP_POST_VARS['buy_tinn_add']) && is_numeric($HTTP_POST_VARS['buy_tinn_add'])) { if (tep_get_products_stock($HTTP_POST_VARS['buy_tinn_add']) > 0) { $cart->add_cart($HTTP_POST_VARS['buy_tinn_add'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['buy_tinn_add'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']); } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; and to make it work together with 2gether contribution add the line of code (displayed in bold) in .../includes/modules/2gether.php around line 104 and it should look like that : echo tep_draw_hidden_field('products_id', $product_a['products_id']) . tep_draw_hidden_field('quantity',1) . tep_draw_hidden_field('buy_tinn_add', $product_b['products_id']) . tep_image_submit('button_buy_now.gif', IMAGE_BUTTON_BUY2GETHER); Hope this is of any help.... Quote
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.
Note: Your post will require moderator approval before it will be visible.