Forums / Templates, Stylesheets, Page Layout / Help with call for price and add to cart buttons

Help with call for price and add to cart buttons

Views: 2,257

Results 1 to 20 of 25
12 Jul 2014, 9:14 PM
#1
jwaynehinkle avatar

jwaynehinkle

New Zenner

Join Date:
Aug 2013
Location:
United States
Posts:
73
Plugin Contributions:
0

Help with call for price and add to cart buttons

I am in need of being able to disable the add to cart buttons, and buy now buttons and quanitity boxes when an item is call for price or replacing it with call for price text, I was looking in my product_listing.php file and found this code

qty box with add to cart button
            if (PRODUCT_LIST_PRICE_BUY_NOW == '2' && $listing->fields['products_qty_box_status'] != 0) {
              $lc_button= zen_draw_form('cart_quantity', zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $listing->fields['products_id']), 'post', 'enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($listing->fields['products_id'])) . '" maxlength="6" size="4" class="m-wrap"/>' . zen_draw_hidden_field('products_id', $listing->fields['products_id']) . '<br /><button type="submit" class="button large">'.BUTTON_IN_CART_ALT.'</button></form></div>';
            } else {
              $lc_button = '<a class="button large" href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . BUTTON_IN_CART_ALT . '</a>';
            }
          }

and was starting to try to toy with it but am not sure I am on the right track this is what I was thinking but I do not think it is coded correctly and also am not sure if it is in the right file or not

qty box with add to cart button
          if $listing->fields['product_is_call'] == 1 || PRODUCTS_PRICE_IS_CALL_FOR_PRICE_TEXT == '1')
               else {
                if (PRODUCT_LIST_PRICE_BUY_NOW == '2' && $listing->fields['products_qty_box_status'] != 0) {
              $lc_button= zen_draw_form('cart_quantity', zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $listing->fields['products_id']), 'post', 'enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($listing->fields['products_id'])) . '" maxlength="6" size="4" class="m-wrap"/>' . zen_draw_hidden_field('products_id', $listing->fields['products_id']) . '<br /><button type="submit" class="button large">'.BUTTON_IN_CART_ALT.'</button></form></div>';
            } else {
              $lc_button = '<a class="button large" href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . BUTTON_IN_CART_ALT . '</a>';
            }
          }
12 Jul 2014, 9:26 PM
#2
jwaynehinkle avatar

jwaynehinkle

New Zenner

Join Date:
Aug 2013
Location:
United States
Posts:
73
Plugin Contributions:
0

Re: Help with call for price and add to cart buttons

I noticed if I turn on showcase mode it adds a contact us box instead of a add to cart box, does anyone know if I can right a rule and insert it somewhere to do the same thing except if product is call for price then show contact us instead of add to cart, and if product is not call for price then show add to cart?

12 Jul 2014, 10:31 PM
#3
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Help with call for price and add to cart buttons

I'm not sure what the question is. By default, if a product is set to call For Price, the Add to Cart box is not displayed for that product.

12 Jul 2014, 10:31 PM
#4
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Help with call for price and add to cart buttons

jwaynehinkle:

I noticed if I turn on showcase mode it adds a contact us box instead of a add to cart box, does anyone know if I can right a rule and insert it somewhere to do the same thing except if product is call for price then show contact us instead of add to cart, and if product is not call for price then show add to cart?So what I see is that if a product is set as call for price, the image call for price is displayed , and the price is displayed with the add to cart button redirected to the contact us page (which if populated would contain the phone number). The only further issue I see is that at least in my setup, the price is still displayed... I would have thought that the price would be hidden in a call for price situation, but perhaps thaat is the code that needs to be modified: if a product is call for price, wherever the price is to be displayed then either nothing is returned or the statement call for price is provided. I think that the area you were looking in is the wrong place considering the change to the product page when the prodict is set to call for price.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

12 Jul 2014, 10:33 PM
#5
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Help with call for price and add to cart buttons

I guess the price could be left blank and that would prevent such price display.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

12 Jul 2014, 11:13 PM
#6
jwaynehinkle avatar

jwaynehinkle

New Zenner

Join Date:
Aug 2013
Location:
United States
Posts:
73
Plugin Contributions:
0

Re: Help with call for price and add to cart buttons

in my store this does not happen, please see this link http://bullysperformance.com/1500-8ft-bed-24129-211.html all of my call for price items are like this.

12 Jul 2014, 11:13 PM
#7
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Help with call for price and add to cart buttons

mc12345678:

I guess the price could be left blank and that would prevent such price display.

That's the way I did it.

12 Jul 2014, 11:16 PM
#8
jwaynehinkle avatar

jwaynehinkle

New Zenner

Join Date:
Aug 2013
Location:
United States
Posts:
73
Plugin Contributions:
0

Re: Help with call for price and add to cart buttons

If I set the price to 0 it allows you to still add to cart in my store and it adds it for $0

13 Jul 2014, 12:11 AM
#9
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Help with call for price and add to cart buttons

Please provide a link to a Call for Price product on your site.

13 Jul 2014, 12:27 AM
#11
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Help with call for price and add to cart buttons

jwaynehinkle:

If I set the price to 0 it allows you to still add to cart in my store and it adds it for $0

A value of 0 is not the same thing as leaving the field blank...

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

13 Jul 2014, 12:28 AM
#12
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Help with call for price and add to cart buttons

jwaynehinkle:

in my store this does not happen, please see this link http://bullysperformance.com/1500-8ft-bed-24129-211.html all of my call for price items are like this.

Seeing the template, it may be that the template doesn't properly handle a call for price selection. Do you have the same issue if you temporarily change to the classic green template for that product?

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

13 Jul 2014, 2:08 AM
#13
jwaynehinkle avatar

jwaynehinkle

New Zenner

Join Date:
Aug 2013
Location:
United States
Posts:
73
Plugin Contributions:
0

Re: Help with call for price and add to cart buttons

mc12345678:

Seeing the template, it may be that the template doesn't properly handle a call for price selection. Do you have the same issue if you temporarily change to the classic green template for that product?

yes the same thing happens, and I do not see a way to just leave it blank whenever I delete the value and then click out of the box it auto adds "0" for a value.

13 Jul 2014, 2:36 AM
#14
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Help with call for price and add to cart buttons

jwaynehinkle:

yes the same thing happens, and I do not see a way to just leave it blank whenever I delete the value and then click out of the box it auto adds "0" for a value.

Would think would want to compare current installation with default and include a review of overrides to be sure. Stevesh and I are able to perform the action desired without issue. (I tried in both normal and classic templates). And okay, so it does populate a zero, but even the demo products a zero is there and when the product is marked call for price the add to cart button is disabled. Something has overridden that for you. It could also be in an override file like listening for an event.

What plugins do you have installed or mods? What is the source of your template? (I didn't look at the source page yet to see if there was a template author listed.)

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

13 Jul 2014, 5:17 AM
#15
jwaynehinkle avatar

jwaynehinkle

New Zenner

Join Date:
Aug 2013
Location:
United States
Posts:
73
Plugin Contributions:
0

Re: Help with call for price and add to cart buttons

I have alot of mods installed and custom code and overrides in place for features I needed that didn't have plug-ins available, I will install a dummy store and compare files, could someone tell me what files I might want to look at or at least a good place to start, if I see the store to be showcase with prices it acts as I expect it too wonder if there is a quick solution where I could insert some code into a file and tell it if product is call for price treat it as showcase w/o price? I know it might not be the best solution but it may work until I can identify the break and fix it correctly, thanks for all the help so far everyone hoping to get this resolved or at least patched up soon with a band aid if you will.

13 Jul 2014, 5:39 AM
#16
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Help with call for price and add to cart buttons

jwaynehinkle:

I have alot of mods installed and custom code and overrides in place for features I needed that didn't have plug-ins available, I will install a dummy store and compare files, could someone tell me what files I might want to look at or at least a good place to start, if I see the store to be showcase with prices it acts as I expect it too wonder if there is a quick solution where I could insert some code into a file and tell it if product is call for price treat it as showcase w/o price? I know it might not be the best solution but it may work until I can identify the break and fix it correctly, thanks for all the help so far everyone hoping to get this resolved or at least patched up soon with a band aid if you will.

Thing is, it's likely a quick fix anyways, especially if use a text comparison tool such as winmerge or similar.

As far as comparisons, I might suggest just base code to base code specifically since the problem appears when in default classic mode as well as when using your current template. That indicates either the classic template and your current one had the same modifications, or the default template was changed rather than your active/current template. Probably looking for/at module files I would think. Typical edited/overridden files are module and template. Although functions may get overridden.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

13 Jul 2014, 10:45 AM
#17
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,109
Plugin Contributions:
56

Re: Help with call for price and add to cart buttons

jwaynehinkle:

here is a link to one http://bullysperformance.com/1500-8ft-bed-24129-211.html
That's not a standard display of a call-for-price product. Looking at the Zen Cart sample products, the call-for-price product displays with no price, no add-to-cart/qty box but a "call for price" box with a link to the contact_us page.

Perhaps if you posted a screenshot of the product's definition (leaving out any sections that will identify the name of your admin folder), we could help more ... especially when you indicate that changing to the classic template doesn't affect the display.

Have you made any changes to /includes/functions/functions_prices.php? That's the file that contains the function zen_get_products_display_price (which is where the call-for-price box should come from).

13 Jul 2014, 2:42 PM
#18
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Help with call for price and add to cart buttons

Actually, Call for Price will display the Price if a Price is set, however, all Add to Cart/Buy Now buttons are changed to prevent Product from being added to the cart ...

So if you want no Price to "tease" the customer into Calling for the presumed better Price than what they are seeing, do not set a Price ...

Either way, you cannot add Call to Price Products to the cart, unless you have messed up the code that manages the price display and the button display or changed something in your custom template/original core files that alters this feature ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

14 Jul 2014, 1:49 AM
#19
jwaynehinkle avatar

jwaynehinkle

New Zenner

Join Date:
Aug 2013
Location:
United States
Posts:
73
Plugin Contributions:
0

Re: Help with call for price and add to cart buttons

Ajeh this is what I am thinking has happened what would be a good file to start at looking at so that I can get it switched back to normal function?

14 Jul 2014, 1:58 AM
#20
jwaynehinkle avatar

jwaynehinkle

New Zenner

Join Date:
Aug 2013
Location:
United States
Posts:
73
Plugin Contributions:
0

Re: Help with call for price and add to cart buttons

just checked with winmerge and the funtions_prices.php are the same for the most part, the only modifications are indeed not affecting what is happening on my store I verified this by replacing it with the original source file and there is no difference in how my store acts, where should I look next?

Thanks in advance!