Jump to content

Show just price and nothing else


vittyc

Recommended Posts

I'm adding products with free domain but when I preview it in the front-end it comes up with;

"£2.49 GBP Monthly (Free Domain)"

Is there a way so it just shows "£2.49" and not "GBP Monthly (Free Domain)" ?

I've tried;

{$product.pricing.minprice.cycleText}

{$product.pricing.monthly} 

Any help and tips would be great thanks

Link to comment
Share on other sites

Hi Sam,

17 hours ago, vittyc said:

I'm adding products with free domain but when I preview it in the front-end it comes up with;

"£2.49 GBP Monthly (Free Domain)"

Is there a way so it just shows "£2.49" and not "GBP Monthly (Free Domain)" ?

the front-end implies the Products page, but I can't recall it displaying 'Free Domain' there before... it will at the Product Configuration stage when it shows the billingcycle dropdown options.

where are you seeing it? which orderform template are you using and is this an English-only GBP site ?

Link to comment
Share on other sites

38 minutes ago, brian! said:

Hi Sam,

the front-end implies the Products page, but I can't recall it displaying 'Free Domain' there before... it will at the Product Configuration stage when it shows the billingcycle dropdown options.

where are you seeing it? which orderform template are you using and is this an English-only GBP site ?

Hi Brian,

Thanks for getting back and yes sorry, front-end (should've been specific) and i'm using the "Premium Comparison" template attached an image and yeah on my local server, the currency is GBP.

 

Capture.PNG

Link to comment
Share on other sites

in the products.tpl template, you should be able to use any of the following (inside the foreach loop) to show £1.99 GBP...

{$product.pricing.minprice.price}
{$product.pricing.minprice.simple}

the minprice will be the smallest billing cycle (e.g monthly, quarterly, semi, annual etc in that order) - not necessarily the cheapest price.

Link to comment
Share on other sites

3 minutes ago, brian! said:

in the products.tpl template, you should be able to use any of the following (inside the foreach loop) to show £1.99 GBP...


{$product.pricing.minprice.price}

{$product.pricing.minprice.simple}

the minprice will be the smallest billing cycle (e.g monthly, quarterly, semi, annual etc in that order) - not necessarily the cheapest price.

Thanks Brian,  {$product.pricing.minprice.simple} worked thanks for monthly, but for annually I'm getting  "GBP Annually "

I tried alternatives but either breaks for stays the same, any ideas?

Link to comment
Share on other sites

HI Sam,

if you wanted to show multiple cycle prices for the same product, you'd either have to take the raw price for the billing cycle (2.49) and add currency prefix and/or suffix to it...

{$currency.prefix}{$product.pricing.rawpricing.monthly}{$currency.suffix}

e.g the above would show £2.49 GBP... take out the suffix code and it would show £2.49 - same would apply for annual prices and the other billing cycles too...

{$currency.prefix}{$product.pricing.rawpricing.annually}{$currency.suffix}

if the value of $product.pricing.rawpricing.monthly (or any other cycles) equals -1, then the product isn't priced for that billing cycle.

... or the other way is to take your full text price and strip it after the first space..

{$product.pricing.cycles.monthly}

for you, the above code would show £2.49 GBP Monthly (Free Domain)...

{$product.pricing.cycles.monthly|strstr:' ':true}

and this would show just £2.49 with no additional text.

a third way, if you're doing some form of showing multiple prices of a product (list, dropdown etc) would be to loop through the $product.pricing.cycles or $product.pricing.rawpricing arrays and output the prices like that... I did something similar for the Pure Comparison template in a previous post... the code wouldn't be exactly the same, but it wouldn't be a million miles away.

note the $product.pricing.cycles array will contain ONLY those cycles for which the product is priced - whereas the rawpricing array contains prices and fees for all cycles whether priced or not.

Link to comment
Share on other sites

21 hours ago, brian! said:

HI Sam,

if you wanted to show multiple cycle prices for the same product, you'd either have to take the raw price for the billing cycle (2.49) and add currency prefix and/or suffix to it...


{$currency.prefix}{$product.pricing.rawpricing.monthly}{$currency.suffix}

e.g the above would show £2.49 GBP... take out the suffix code and it would show £2.49 - same would apply for annual prices and the other billing cycles too...


{$currency.prefix}{$product.pricing.rawpricing.annually}{$currency.suffix}

if the value of $product.pricing.rawpricing.monthly (or any other cycles) equals -1, then the product isn't priced for that billing cycle.

... or the other way is to take your full text price and strip it after the first space..


{$product.pricing.cycles.monthly}

for you, the above code would show £2.49 GBP Monthly (Free Domain)...


{$product.pricing.cycles.monthly|strstr:' ':true}

and this would show just £2.49 with no additional text.

a third way, if you're doing some form of showing multiple prices of a product (list, dropdown etc) would be to loop through the $product.pricing.cycles or $product.pricing.rawpricing arrays and output the prices like that... I did something similar for the Pure Comparison template in a previous post... the code wouldn't be exactly the same, but it wouldn't be a million miles away.

note the $product.pricing.cycles array will contain ONLY those cycles for which the product is priced - whereas the rawpricing array contains prices and fees for all cycles whether priced or not.

Thanks for the continued help Brian, definately getting there! 

I used; 

{$currency.prefix}{$product.pricing.rawpricing.annually}{$currency.suffix}

and it came back with £50 GBP which is the right price but don't want GBP there....

Link to comment
Share on other sites

21 hours ago, vittyc said:

Will that have any bad effect, anywhere else?

no - it's just a bit of optional text... it only becomes awkward when you want to use it there, but not here... but if you're aiming primarily at a UK audience, then it makes sense to remove it entirely as it's only relevant in a multi-currency environment.

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
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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated