Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Addon] Price in Cart Only/MAPP Support


Recommended Posts

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 by kymation

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

That should work. Check that the price_in_cart column has been added to the products table in your database.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Yes, it is.

 

dot.gif Edit dot.gif Copy dot.gif 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

Link to comment
Share on other sites

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

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

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

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

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

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...