You are here:  » merchant content


merchant content

Submitted by paullas on Wed, 2012-09-12 13:37 in

hi david

is it possible to display merchant content using a specific calling code. so for example if you look at {link saved} i would like to display content from a html file above the results.

thanks

Paul

Submitted by support on Wed, 2012-09-12 14:14

Hello Paul,

Sure - a plugin equivalent of this mod - create the same folder "merchantinfo" within the Price Tapestry installation (e.g. /pt.merchantinfo) and create the merchant info filenames as

/pt/merchantinfo/Merchant Name.html

Then in pto_search.php look for the following code at line 439:

$html = "";

...and REPLACE with:

$html = "";
global $pto_q;
global $pto_page;
global $pto_config_externalPath;
$parts = explode(":",$pto_q);
if (($parts[0]=="merchant") && ($pto_page==1))
{
  $merchantinfoFilename = $pto_config_externalPath."merchantinfo/".$parts[1].".html";
  if (file_exists($merchantinfoFilename))
  {
    $html .= file_get_contents($merchantinfoFilename);
  }
}

Cheers,
David.
--
PriceTapestry.com

Submitted by paullas on Wed, 2012-09-12 18:43

hi david

i have tried the above on {link saved} but it isnt showing the content from {link saved}

any ideas?

thanks

paul

Submitted by support on Wed, 2012-09-12 19:03

Hello Paul,

The mod relies on the setting "Install Path" under the External section of wp-admin > Settings > PriceTapestry.org. Double check that this is set correctly - it should contain the value as shown on the /pt/admin/ Support Info page.

That should be all it is...

Cheers,
David.
--
PriceTapestry.com

Submitted by paullas on Wed, 2012-09-12 19:05

spot on thanks agaoin.

Submitted by stonecold111 on Thu, 2014-02-13 04:52

Hi David,

I want to display extra info for some featured products on the featured page. May I know what code to add to the featured page?
I have tried the ones from product.php and search.php, but they won't work on featured pages.

Submitted by support on Thu, 2014-02-13 08:22

Hi,

Based on the same principal, start by creating the folder "featuredinfo" within the Price Tapestry installation (e.g. /pt/featuredinfo) and create the info filenames as

/pt/merchantinfo/Product Name.html

Then in pto_featured.php look for the following code at line 172:

  $html .= $each;

...and REPLACE with:

  global $pto_config_externalPath;
  $featuredinfo = "";
  $featuredinfoFilename = $pto_config_externalPath."featuredinfo/".$row->name.".html";
  if (file_exists($featuredinfoFilename))
  {
    $featuredinfo = file_get_contents($featuredinfoFilename);
  }
  $each = str_replace("%INFO%",$featuredinfo,$each);
  $html .= $each;

Finally, in your Featured Products / Each template (wp-admin > Settings > PriceTapestry.org ), insert the plaeholder %INFO% at the point at which you want to pull the contents of the info .html file in...

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by stonecold111 on Thu, 2014-02-13 10:40

Hi David,

I assume that $merchantinfoFilename should be $featuredinfoFilename in your code. I've created a folder "featuredinfo" with a product.html but it only shows the word "featuredinfo" instead of the content of the file.

Submitted by stonecold111 on Thu, 2014-02-13 10:41

My code:

{code saved}

Submitted by support on Thu, 2014-02-13 12:11

Hi,

Sorry about that - replacement corrected above - you're correct regarding $merchantinfoFilename but also featuredinfo should be $featuredinfo...

Cheers,
David.
--
PriceTapestry.com