♥kymation Posted May 9, 2013 Share Posted May 9, 2013 (edited) This addon allows you to show the price of any product only after it has been added to the cart. This satisfies some manufacturers' "Minimum Advertised Price Policies" (MAPP). You can select this option for any product when you first add the product to your store, or you can edit any product later. When selected, the product price is replaces with text and a link to an explanatory popup. You can change any of this text at any time. This Addon should only be used when the manufacturer has a minimum advertised price for certain products and you price is lower. Customers generally don't like hidden prices. The code is here. Regards Jim Edited May 9, 2013 by kymation Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
Nico01 Posted May 14, 2013 Share Posted May 14, 2013 Hallo Jim, thanks for sharing your work. I run v2.3.3 on 5.5.27 - MySQL. I got this Error: 1054 - Unknown column 'p.price_in_cart' in 'field list' select products_id, products_image, products_tax_class_id, products_price, p.price_in_cart from products where products_status = '1' order by products_date_added desc limit 10 all files are original from your code, nothing modified on my testing area. Thanks for info Nico Quote Link to comment Share on other sites More sharing options...
♥kymation Posted May 14, 2013 Author Share Posted May 14, 2013 It sounds like you didn't run the price_in_cart.sql to modify your database. Do that now. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
Nico01 Posted May 14, 2013 Share Posted May 14, 2013 Jim, I did it. For sure I set up again - same error issue. This is, what I run in sql: ALTER TABLE `products` ADD `price_in_cart` SET( 'True', 'False' ) NOT NULL DEFAULT 'False' AFTER `products_price` Maybe I forget something... Nico Quote Link to comment Share on other sites More sharing options...
♥kymation Posted May 14, 2013 Author Share Posted May 14, 2013 That should work. Check that the price_in_cart column has been added to the products table in your database. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
Nico01 Posted May 14, 2013 Share Posted May 14, 2013 Yes, it is. Edit Copy Delete 28 100 GT-P1000 samsung/galaxy_tab.gif 749.9900 True 2013-05-14 06:49:58 2013-05-14 07:11:17 2013-05-16 00:00:00 1.00 1 1 If I want to edit the product in the description, I can't remove the checkmark, because it is vanished. Strange, but I let you know, if I found a solution, but I am stll learning ... Thanks for your help Nico Quote Link to comment Share on other sites More sharing options...
♥kymation Posted May 15, 2013 Author Share Posted May 15, 2013 I didn't read the first error message that you posted well enough. My bad. In whatever file that is, replace p.price_in_cart with price_in_cart. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
♥kymation Posted May 15, 2013 Author Share Posted May 15, 2013 As I posted above, there is a bug in the What's New box code. I've posted a new release containing the fix. If you have the previous version, just replace catalog/includes/modules/boxes/bm_whats_new.php with the one from this new release. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
Nico01 Posted May 16, 2013 Share Posted May 16, 2013 Jim, its working now, thanks. Only the pop up doesn't show up. Could be there a missing link from // Price in Cart notice overrides the price display if( $product_info['price_in_cart'] == 'True' ) { $products_price = tep_display_price_in_cart(); } in product_info.php to // Display the Price in Cart notice if( !function_exists( 'tep_display_price_in_cart' ) ) { function tep_display_price_in_cart() { $price_string = '<span class="price_in_cart">' . PHP_EOL; $price_string .= TEXT_ADD_CART_FOR_PRICE . ' ' . PHP_EOL; $price_string .= ' <span class="smalltext">' . PHP_EOL; $price_string .= ' <script language="javascript"><!--' . PHP_EOL; $price_string .= 'document.write(\'' . '<a href="javascript:popupWindow(\\\'' . tep_href_link( FILENAME_POPUP_PRICE_IN_CART ) . '\\\')">' . TEXT_WHY_HIDE_PRICE . '</a>\');' . PHP_EOL; $price_string .= '//--></script>' . PHP_EOL; $price_string .= ' <noscript>' . PHP_EOL; $price_string .= ' <a href="' . tep_href_link (FILENAME_POPUP_PRICE_IN_CART, 'cond=' . $data['rating']) . '" target="_new">' . TEXT_WHY_HIDE_PRICE . '</a>' . PHP_EOL; $price_string .= ' </noscript>' . PHP_EOL; $price_string .= ' </span>' . PHP_EOL; $price_string .= '</span>' . PHP_EOL; return $price_string; } } // Price In Cart end in functions/general.php ? Excuse this kind of question, but I try to understand the code .... Thanks Nico Quote Link to comment Share on other sites More sharing options...
♥kymation Posted May 16, 2013 Author Share Posted May 16, 2013 The code in product_info.php (and every other file that displays the price) calls the function tep_display_price_in_cart(). That function returns a string of code that displays the text telling the customer to add the item to their cart to see the price and a link to the popup explaining why. I'll go test this again, but I'm not seeing a reason why this would not work. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
♥kymation Posted May 16, 2013 Author Share Posted May 16, 2013 The problem was that i left out some critical files. Of course it worked on my test site since it had all the files. Anyway, the new release with the missing files is up, and there are update instructions in the User's manual. I also added some styling that I left out of the stylesheet, if you want to use it. Or just style it yourself. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
Nico01 Posted May 16, 2013 Share Posted May 16, 2013 Jim, now everything is working. For the pop up window I had to change something to make it working: In template_top.php the function: window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=450,height=550,screenX=150,screenY=150,top=150,left=150')\n"; } in window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,left=150') } So I removed \n"; - and now its pop up. Thanks for working this out. Regards Nico Quote Link to comment Share on other sites More sharing options...
♥kymation Posted May 16, 2013 Author Share Posted May 16, 2013 I missed that. Thanks for letting me know, and thank you for your previous bug reports as well. They really help. I'm thinking about changing that popup to a jQuery dialog box. I'll work on that when I have time. Regards Jim Quote See my profile for a list of my addons and ways to get support. 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.