You are here:  » A Banner for a Single Item


A Banner for a Single Item

Submitted by mattwalker on Thu, 2015-11-19 15:40 in

Hi David,

Hope all is well.

I'm using the wordpress plugin. There's a feature I'd like to add but I'm having a few problems.

I'd like the option of using shortcode to add a banner for just one item (the best price) along with a corresponding extra box within PT wordpress options, giving me the ability to style and word it as I like. So basically what I'm after is an duplicate of "Main" box within the "Product" category of PT wordpress options, calling the new box eg: "Banner".

I've got so far adding:

to settings.php:

line 56: $pto_settings_html[] = "pto_html_product_banner";

line 365: pto_settings_html("Banner","pto_html_product_banner",10);

------------------------

to pto.php

line 426: case "banner":

$pto_product = pto_common_normalise($v);

$html .= pto_product(TRUE,FALSE,FALSE,FALSE);

break;

-------------------------

to product.php:

line 397: global $pto_html_product_banner;

line 421: $html_product = ($pto_html_product . $pto_html_product_banner);

The line 421 is where I'm having problems as it's coming out with the result for "Main" aswell as "Banner". Hope what I've modified above is on the right track...?

Thanks for your help,
Matt

Submitted by support on Fri, 2015-11-20 10:37

Hello Matt,

I think what you'd need to do is add a new flag to the pto_product() function - "banner", and if set to TRUE then use $pto_html_product_banner instead of $pto_html_product. To give this a go, in pto_product.php look for the following code around line 343:

  function pto_product($main=FALSE,$prices=FALSE,$reviews=FALSE,$related=FALSE,$banner=FALSE)

Then in place of your modified line 421:

  $html_product = ($banner?$pto_html_product_banner:$pto_html_product);

And then to set the $banner flag, in pto.php in your new line 428:

  $html .= pto_product(TRUE,FALSE,FALSE,FALSE,TRUE);

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by mattwalker on Wed, 2015-11-25 04:48

Thanks, David. That's got it working!