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

Replacing Price with Cufon

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 06-30-2011, 06:15 AM
 
nickff nickff is offline
 

Senior Member
  
Join Date: Aug 2010
Posts: 132
 

Default Replacing Price with Cufon

Hi All,

I'm looking to replace the font for the price on my product details pages with Cufon. This works great, but the issue I'm having is when a product has product variants that change the price dynamically when a new selection is made:

http://future.thefutureforward.com/~aso/Comrade.html

By adding the following to customer_options.tpl around line 49 I am successfully swapping the font when you select a new option, but it's not doing the cufon replacement properly on page load:

HTML Code:
<select id="po{$v.classid}" name="{$poname}"{if $disable} disabled="disabled"{/if}{if $nojs ne 'Y'} onchange="javascript: check_options();Cufon.replace('.details h3', {literal}{fontFamily: 'Flama'}{/literal});"{/if}>

Any thoughts on why my initial replacing isn't working on this would be great.

Thanks!
__________________
nick hoag
looking forward to the future
http://thefutureforward.com
xcart versions 4.2.x, 4.3.x, 4.4.x
Reply With Quote
  #2  
Old 07-04-2011, 02:43 AM
  carlisleglass's Avatar 
carlisleglass carlisleglass is offline
 

eXpert
  
Join Date: Aug 2003
Location: Carlisle, UK
Posts: 316
 

Default Re: Replacing Price with Cufon

Maybe try

Code:
Cufon.refresh();

Just found this as well, which might work:

Replacing ALL Ajax content with jQuery, including any future Ajax requests

Code:
$(document).ajaxSuccess(function() { Cufon.refresh(); });
__________________
Darren Kierman
Carlisle Glass (http://www.carlisleglass.co.uk/)
... running X-Cart Gold 4.4.5 [unix]
Reply With Quote
  #3  
Old 07-05-2011, 05:38 AM
 
nickff nickff is offline
 

Senior Member
  
Join Date: Aug 2010
Posts: 132
 

Default Re: Replacing Price with Cufon

Hi Darren,

Thanks so much for the idea.

I've placed your "ajaxSuccess" code into the file "skin/common_files/modules/Product_Options/check_options.tpl", right towards the top. The price now successfully replaces on page load, but as soon as you change a product option that alters the price, the price won't change and firebug spits out the following error:
default_price is not defined
price = default_price;
in skin/common_files/modules/Product_Options/func.js

You can see this in action here, by trying to change a "frame color":

http://future.thefutureforward.com/~aso/Comrade.html

Let me know if you had another thought on where this code should be placed.

Thanks so much!
__________________
nick hoag
looking forward to the future
http://thefutureforward.com
xcart versions 4.2.x, 4.3.x, 4.4.x
Reply With Quote
  #4  
Old 07-25-2011, 03:51 AM
  carlisleglass's Avatar 
carlisleglass carlisleglass is offline
 

eXpert
  
Join Date: Aug 2003
Location: Carlisle, UK
Posts: 316
 

Default Re: Replacing Price with Cufon

Sorry for the delay in replying.

Cufon adds extra tags and stuff to create the effect. Looks like it might be editing the contents of the div/span which controls the price display to much, and func.js isn't liking it.
__________________
Darren Kierman
Carlisle Glass (http://www.carlisleglass.co.uk/)
... running X-Cart Gold 4.4.5 [unix]
Reply With Quote
  #5  
Old 07-25-2011, 05:53 AM
 
nickff nickff is offline
 

Senior Member
  
Join Date: Aug 2010
Posts: 132
 

Default Re: Replacing Price with Cufon

Yea, that's what I was thinking as well.

Totally at a loss on this one..
__________________
nick hoag
looking forward to the future
http://thefutureforward.com
xcart versions 4.2.x, 4.3.x, 4.4.x
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 10:25 AM.

   

 
X-Cart forums © 2001-2020