You are here:  » calling code

Support Forum



calling code

Submitted by paullas on Fri, 2012-09-07 22:12 in

hi david

is there a calling code to paste into pages/posts to display products from a certain keyword or random.

thanks

paul

Submitted by support on Sat, 2012-09-08 07:34

Hi Paul,

I know you're experimenting with the plugin - the full list of shortcodes can be found here. Adding a special featured products "section" to display random Featured Products is straight forward; in pto_featured/php look for the following code at line 25:

  if ($section)

...snd REPLACE with:

  if ($section=="random")
  {
    $sql = "SELECT name,1 AS sequence FROM `".$pto_config_databaseTablePrefix."products` ORDER BY RAND() LIMIT 3";
  }
  elseif ($section)

...and with that in place you can then use the shortcode:

[pto featured="random"]

...to display 3 random products.

Cheers,
David.
--
PriceTapestry.com

Submitted by paullas on Sat, 2012-09-08 10:07

thanks david, is that the right link you posted as i can not see the short codes.

thanks
paul

Submitted by support on Sat, 2012-09-08 10:27

oops - link corrected...

Cheers,
David.
--
PriceTapestry.com