You are here:  » Featured products not displaying in wordpress install


Featured products not displaying in wordpress install

Submitted by jamie on Wed, 2017-01-04 17:50 in

Hi David,

Please can I check with you how to use the featured products properly in these wordpress installations?

As a test, I can successfully use a shortcode such as:

[pto product="Sony Bravia XYZ"]

However, when I use:

[pto featured=""]

This does not work. Infact, the entire page does not render at all - it is completely blank (no 404).

I have set the featured products in the PT backend (content mgmt -> featured products).

I'm sure its me just not using it correctly, but I cannot figure this one out.

Any ideas?

Thanks
Jamie

Submitted by support on Wed, 2017-01-04 17:57

Hello Jamie,

This will be corrected in the next distribution of PriceTapestry.org for WordPress - currently there are two instances of a direct call to mysql_real_escape_string() in the Featured Products code - whether or not this causes Featured Products not to render depends on underlying PHP / MySQL version. To correct this, edit the plugin file pto_featured.php and look for the following code beginning at line 56:

      $sqlNames[] = "'".mysql_real_escape_string($row->name)."'";
      $sqlCase .= " WHEN '".mysql_real_escape_string($row->name)."' THEN ".$row->sequence;

...and REPLACE with;

      $sqlNames[] = "'".$wpdb->escape($row->name)."'";
      $sqlCase .= " WHEN '".$wpdb->escape($row->name)."' THEN ".$row->sequence;

Cheers,
David.
--
PriceTapestry.com

Submitted by jamie on Wed, 2017-01-04 20:33

That's great, works perfectly now, thanks very much David.

Please could I ask you how the 'sections' work in featured products? I've read the manual but Im still not quite sure - is it a way to only show a couple of the many featured products I have?

Cheers,
Jamie

Submitted by support on Thu, 2017-01-05 09:08

Hi Jamie,

Sections enable you to use the [pto featured="SectionName"] shortcode to show specific products in the Featured Products layout without posts / pages. To specify products, simply prefix product names with SectionName on the Featured Products page of the associated Price Tapestry installation's /admin/ area. For example, if you have:

section1/Product 1
section1/Product 2
section2/Product 3
section2/Product 4

And then you use

[pto featured="section1"]

...then Product 1 and Product 2 will be displayed. Similarly,

[pto featured="section2"]

...will display Product 3 and Product 4.

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by JanezJans on Sun, 2017-03-26 14:12

Just to tell that I had same issue and this solve it.