Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Hidden price module


mhci

Recommended Posts

Hi Everyone

 

I need a way to hide the pricing of specific products on my site.

Rather than show pricing, it should read something like add to cart to see pricing. Once the item has been added to the cart, the pricing should be visible

 

Any thoughs? Does a module for this already exist?

Link to comment
Share on other sites

Sounds like a bad idea to me.

 

Would you walk into your local grocery store and fill up your cart without knowing the prices beforehand?

:unsure:

 

Price is one of the main items that factor into the decision to buy.

 

It should be visible up front, BEFORE adding it to the cart. Other wise if the price is too high they'll just delete it from the cart straight away.

 

This would cause way too many clicks.

 

I'd just get frustrated and shop elsewhere.

 

Just my 2 cents.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

@@mhci

 

Although I agree with Jim, you could add some logic to the product info page to hide the products price for certain items that you define. You could either code an array of product ids in the product_info/product_listing files or add a column to the products table to contain the data and then check it when the product page loads.

 

Sounds like a lot of work unless you have a really good reason to hide them like this.

Matt

Link to comment
Share on other sites

@@burt

I would like to see this in one line of code. Since it will only apply to certain items there has to be some logic to check if the item being viewed is one of those items. Also, wouldn't the "no price" items need to be stored in an array or something?

 

haha I'm probably missing something here so we will see what happens. You do have a way of surpising me with simple one-liners :)

Matt

Link to comment
Share on other sites

The why is probably something like Amazon uses it... ie. implying that this product is sold at such a low price that they are not allowed to list the price outright.

 

It would be something as easy as adding a hide price filed to the product db and then code the different modules, boxes and pages at the site to show or hide prices depending on that.

 

(or of course if its just a few products adding in a hardcoded array just for those instead of adding anything to the db)

Link to comment
Share on other sites

Thanks for all the replies

 

Yes, I agree hiding the price until the customer adds the item to their cart is not good for business however the alternative would be posting a much higher price than your willing to sell for. (mapp pricing) much worse.

The products/prices that would need to be hidden would change on an ongoing basis and the number of products is growing weekly as more manufactureers are moving toward mapp pricing.

I am interested in Nick's solution. How difficult would that be to implement?

Also, could the price be replaced text "add to cart to see price"

 

Thanks again for all your thoughts!

Link to comment
Share on other sites

The why is probably something like Amazon uses it... ie. implying that this product is sold at such a low price that they are not allowed to list the price outright.

 

It would be something as easy as adding a hide price filed to the product db and then code the different modules, boxes and pages at the site to show or hide prices depending on that.

 

(or of course if its just a few products adding in a hardcoded array just for those instead of adding anything to the db)

 

Thanks for all the reply

 

Yes, I agree hiding the price until the customer adds the item to their cart is not good for business however the alternative would be posting a much higher price than your willing to sell for. (mapp pricing) much worse.

The products/prices that would need to be hidden would change on an ongoing basis and the number of products is growing weekly as more manufactureers are moving toward mapp pricing.

I am interested in Nick's solution. How difficult would that be to implement?

Also, could the price be replaced with text "add to cart to see price"

 

Thanks again for all your thoughts

Link to comment
Share on other sites

I've done this, but the store it's on is heavily modified, so I'll have to dig out the code. It's triggered by a new field in the products database table. If that field is set to true, it displays text in place of the price, with a link to a popup that explains the reason for not showing the price. Not a difficult thing to add, but you have to find every place the price is shown and replace the code there. It's more tedious than difficult. I can dig out the code bits and post them if this sounds like what you want.

 

Regards

Jim

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

Link to comment
Share on other sites

I'm thinking out loud;

 

display price function in the currencies class and global the $cart also in there. If we then parse the product_id through that with a loop in_cart (admittedly we have the tedious job of changing each "display_price" call as per @@kymation), I think it would do it.

Link to comment
Share on other sites

You still need to pass the products_id to $currencies->display_price so it knows to swap out the price. That could also get weird when the Product Listing module shows the crossed-out regular price.

 

There's got to be a cleaner way to do this....

 

Regards

Jim

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

Link to comment
Share on other sites

Details on a no-price set-up here:

 

http://www.oscommerce.com/forums/topic/387605-hide-buy-now-button-from-products-marked-price-on-application

 

I recall an option in addons for a no price store at one time. I had a store with posts for all the products that showed no prices, and comments were set up for the products, so it was sort of like a blog, but I much prefer wordpress now, and regret ever setting up that 'store.'

Web Developer, Firebug, and Notepad++ are powerful free tools for web design.

Link to comment
Share on other sites

I've done this, but the store it's on is heavily modified, so I'll have to dig out the code. It's triggered by a new field in the products database table. If that field is set to true, it displays text in place of the price, with a link to a popup that explains the reason for not showing the price. Not a difficult thing to add, but you have to find every place the price is shown and replace the code there. It's more tedious than difficult. I can dig out the code bits and post them if this sounds like what you want.

 

Regards

Jim

 

That sounds like exactly what I would need.

When you say I would have to find every place the price is shown and replace the code there... would that be for only the products i want to apply the hidden price to?

How many different places would a price be shown for each item?

Also when adding a new product to the site would the same changes need to be made?

Sorry for all the questions and thanks alot for your help!

Link to comment
Share on other sites

All of the products appear on the same pages. Think of them as templates for the page to show various products, lists of products, etc. So you need to change index.php, product_listing.php, product_info.php, the reviews pages, new products page, etc. I need to look at my code to get all of them.

 

The price generally only shows once on a page for each product. Some pages, such as the category list of products, might show several products that have the price hidden in this way.

 

You would have a selection box in the admin Categories/Products page to select whether you want the price hidden for that particular product.

 

I'm digging through the code and adding all of the pieces to a new copy of osC. I'll let you test it when I get it put together. Unless @@burt comes up with a better way to do this.

 

Regards

Jim

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

Link to comment
Share on other sites

All of the products appear on the same pages. Think of them as templates for the page to show various products, lists of products, etc. So you need to change index.php, product_listing.php, product_info.php, the reviews pages, new products page, etc. I need to look at my code to get all of them.

 

The price generally only shows once on a page for each product. Some pages, such as the category list of products, might show several products that have the price hidden in this way.

 

You would have a selection box in the admin Categories/Products page to select whether you want the price hidden for that particular product.

 

I'm digging through the code and adding all of the pieces to a new copy of osC. I'll let you test it when I get it put together. Unless @@burt comes up with a better way to do this.

 

Regards

Jim

 

Ok -Great! - Thanks again

Link to comment
Share on other sites

Files are attached. I don't have time to write instructions right now, so you'll have to make do. Use a good comparison program (Meld, Winmerge) to compare the files to yours. All of the changes are marked with:

// Price In Cart start
 /* Several lines of code here */
// Price In Cart end

 

for multi-line changes, and:

 

//Price In Cart
/* Line of code here */

 

for single line changes. The latter usually contain a note for what's changed. There's also a SQL file to add the field to the products table.

 

Post any questions/comments here.

 

Regards

Jim

price_in_cart_1.0.tar.gz

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

Link to comment
Share on other sites

Files are attached. I don't have time to write instructions right now, so you'll have to make do. Use a good comparison program (Meld, Winmerge) to compare the files to yours. All of the changes are marked with:

// Price In Cart start
 /* Several lines of code here */
// Price In Cart end

 

for multi-line changes, and:

 

//Price In Cart
/* Line of code here */

 

for single line changes. The latter usually contain a note for what's changed. There's also a SQL file to add the field to the products table.

 

Post any questions/comments here.

 

Regards

Jim

 

Thank you very much!

 

I will test this tonight and let you know how it goes.

I'm new to the forum and can't believe I waitted this long to use it. The help has been great!

Link to comment
Share on other sites

My thought was somewhat similar to @@kymation, but I'm far too lazy to put it together. So, well done Jim :)

 

I was thinking;

 

- the admin part of the Hazmat module (allows to set product flags, 0 = no show or 1 = show)

- Pass the product_id through the display_price functions (would need to have the display_price function changed to determine whether to show or not, and if it's a not, do show it if the product is in_cart, and every instance of display price thoughout the site changed to suit).

 

to test the theory, I did this:

 

function display_price($products_price, $products_tax, $quantity = 1, $pid = '') {
  global $cart;
  $hide_array = array(3);

  return ( (!in_array((int)$pid, $hide_array)) || ($cart->in_cart((int)$pid)) ) ? $this->format($this->calculate_price($products_price, $products_tax, $quantity)) : 'add to cart for price';
   }

 

Seems to work after a fashion.

Link to comment
Share on other sites

Would be so much easier to just not show prices across the whole shop, except the total on shopping_cart.php page...

 

function display_price($products_price, $products_tax, $quantity = 1) {
 return NULL;
}

 

I haven't tested but that might also be enough?

Link to comment
Share on other sites

Thank you very much!

 

I will test this tonight and let you know how it goes.

I'm new to the forum and can't believe I waitted this long to use it. The help has been great!

 

Ok - So I installed the hidden price module and here are the results

The price is in fact hidden on the product details page and then does show up when the item is placed in the cart - PERFECT!

However, when browsing the site, without being on a specific product page, the price of the items I wanted hidden is still visible. Any thoughts?

Link to comment
Share on other sites

Files are attached. I don't have time to write instructions right now, so you'll have to make do. Use a good comparison program (Meld, Winmerge) to compare the files to yours. All of the changes are marked with:

// Price In Cart start
 /* Several lines of code here */
// Price In Cart end

 

for multi-line changes, and:

 

//Price In Cart
/* Line of code here */

 

for single line changes. The latter usually contain a note for what's changed. There's also a SQL file to add the field to the products table.

 

Post any questions/comments here.

 

Regards

Jim

Ok - So I installed the hidden price module and here are the results

The price is in fact hidden on the product details page and then does show up when the item is placed in the cart - PERFECT!

However, when browsing the site, without being on a specific product page, the price of the items I wanted hidden is still visible. Any thoughts?

Link to comment
Share on other sites

You would have to say which page you're seeing the prices on.

 

Regards

Jim

 

Hi Jim

 

Example:

 

The item has the hide price option applied in the admin but the price is still visible - (Should be hidden)

 

http://www.mississaugahardware.com/gvtest/store/advanced_search_result.php?keywords=5377mg

 

Here the item is has been clicked to see more details - the price is hidden (As it should be)

http://www.mississaugahardware.com/gvtest/store/product_info.php/products_id/1164

 

Here the item has been placed in the cart - price is visible - (As it should be)

http://www.mississaugahardware.com/gvtest/store/shopping_cart.php

Link to comment
Share on other sites

Your site is password protected, so I can't check it directly, but I shouldn't need to. You've missed the change to advanced_search_result.php or the changes in includes/product_listing.php.

 

Regards

Jim

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

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...