Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

variants - call for price

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-25-2012, 03:30 AM
 
Jon Foote Jon Foote is offline
 

Newbie
  
Join Date: Apr 2011
Posts: 5
 

Default variants - call for price

hi,

in 4.4.5 how would i make certain variants display call for price instead of the variant price (set to 0 at the moment)

im guessing its a javascript thing, as the price automatically changes with the variants dropdown?

thanks
__________________
Version 4.4.2
Reply With Quote
  #2  
Old 04-25-2012, 05:32 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: variants - call for price

Hi Jon. I looked into this for you and found that the template that controls this JS is: **YOUR-SKIN-DIR**/modules/Product_Options/func.js

Around line 187 find this:
/* Update price */
if (document.getElementById('product_price'))
document.getElementById('product_price').innerHTML = price;

And change it to:
/* Update price */
if (document.getElementById('product_price'))
if (price == '0'){
price = "Call";
document.getElementById('product_price').innerHTML = price;
} else {
document.getElementById('product_price').innerHTML = price_format(Math.max(price, 0));
}

Now this isn't going to handle everything for you, this is just an example of where to get started, and how to go about making the change that you want. There may be other ways, this was the first solution I came across.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote

The following 2 users thank totaltec for this useful post:
Duramax 6.6L (05-10-2012), Jon Foote (04-25-2012)
  #3  
Old 04-25-2012, 06:05 AM
 
Jon Foote Jon Foote is offline
 

Newbie
  
Join Date: Apr 2011
Posts: 5
 

Default Re: variants - call for price

thanks for that, it was easier than i thought.

i changed it a bit to...

if (price == 0) {
$('.currency').hide();
$('.callforprice').show();
} else {
$('.currency').show();
$('.callforprice').hide();
document.getElementById('product_price').innerHTML = price_format(Math.max(price, 0));
}


so it hides the currency symbol and shows a span with my call for price message
__________________
Version 4.4.2
Reply With Quote

The following 2 users thank Jon Foote for this useful post:
Duramax 6.6L (04-25-2012), totaltec (04-25-2012)
  #4  
Old 04-25-2012, 07:26 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: variants - call for price

Great. Thanks for posting your final solution. It sure helps the forum be the type of resource that it should be when you do that. Glad it was an easy fix.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #5  
Old 04-16-2013, 03:10 PM
 
snowman99 snowman99 is offline
 

Member
  
Join Date: Feb 2007
Posts: 21
 

Default Re: variants - call for price

I need a 'call for price' on a variant. To be more clear, I currently have it working for the price on the variant but I don't know how to disable the add-to-cart button in product_details.tpl since the price is set with a javascript call (check_options in func.js). Once the function returns I need to know if the price is zero or have a variable I can check. Any ideas? Maybe I'm doing this the wrong way.

Thanks,
__________________
X-cart Ver: 4.7.10 (Linux/Apache)
XCartMods Ultra Template
BCSE Authorize DPM Module
CDSEO 2.2.0
CDSEO Pro Admin
Reply With Quote
  #6  
Old 04-16-2013, 10:44 PM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

X-Man
  
Join Date: Jan 2008
Posts: 2,613
 

Default Re: variants - call for price

IMHO call for price feature shouldn't be used in an online store. Just think about you ask a potential customer to call you just for finding a price. I am wondering how many will do a phone call. Personally I won't do that. Same thing for asking login to see prices.
__________________
X-Cart Next: Business 5.2 (learning and testing)
X-Cart Classic: Gold and Gold Plus 4.7
Lots of Modules and Customizations
OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux
Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions)

You can catch my ideas here: http://ideas.x-cart.com
Reply With Quote
  #7  
Old 04-16-2013, 11:41 PM
 
snowman99 snowman99 is offline
 

Member
  
Join Date: Feb 2007
Posts: 21
 

Default Re: variants - call for price

Thanks. Actually, I have the same opinion. But in this case, it's expensive gold jewelry and the supplier is constantly changing the price.
__________________
X-cart Ver: 4.7.10 (Linux/Apache)
XCartMods Ultra Template
BCSE Authorize DPM Module
CDSEO 2.2.0
CDSEO Pro Admin
Reply With Quote
  #8  
Old 04-16-2013, 11:49 PM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

X-Man
  
Join Date: Jan 2008
Posts: 2,613
 

Default Re: variants - call for price

As an advice you should show a price, but ask the customer for confirmation because of a strong reason. From the very beginning you give him an idea about how much costs, then it needs a confirmation (it could be +/-). This will help you not losing customers who are stressed by calling for prices. You can also monitor your pages in real time and check how many calls you get for the most visited products.
__________________
X-Cart Next: Business 5.2 (learning and testing)
X-Cart Classic: Gold and Gold Plus 4.7
Lots of Modules and Customizations
OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux
Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions)

You can catch my ideas here: http://ideas.x-cart.com
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:31 AM.

   

 
X-Cart forums © 2001-2020