You are here:  » Multiple PT on one Wordpress Multisite website


Multiple PT on one Wordpress Multisite website

Submitted by marco@flapper on Wed, 2011-11-16 09:49 in

Hi,
I'm building a Pricetapestry website but want to have an additional level above the brand, merchant, category and a random featured products homepage. I'm considering my options. Could you advise me on this?

I could install a normal PT without the Wordpress plugin twice, but would prefer the Wordpress plugin but the plugin would only support one pt installation. If an additional database field would be added I guess this would mean a lot of changes and make updating the PT software more difficult to update as it would include extra steps? Or is it easier than I would assume?

Submitted by support on Wed, 2011-11-16 12:07

Hi Marco,

With a Multiside by sub-directory installation you should be able to do exactly as you require by having PriceTapestry.org enabled for all installations, and making use of the %MU_ID% placeholder (mode info) in wp-admin > Settings > PriceTapestry.org and then in Base HREF, Install Path and $config_databaseTablePrefix as required.

That should do the trick, but rather than the example on the page linked above, the set-up would be something like:

http://www.example.com/multisite2/
http://www.example.com/multisite3/

...accessing the corresponding Price Tapestry installations:

http://www.example.com/pt_2/
http://www.example.com/pt_3/

Cheers,
David.

Submitted by marco@flapper on Wed, 2011-11-16 12:50

Hi,
I used sub-domain of Wordpress multisite, but I could install a sub-directory Wordpress multisite.

But I guess I could use this contruction only once per multisite as it would require the main site.

I would prefer to minimize the number of Wordpress installations. Is there an alternative of would it be better (in this case) to go for two standalone Pricetapsetry installtion?

Would that be something like this?

http://www.example.com/pt_2/
http://www.example.com/pt_3/

and what needs to be done to show on http://www.example.com/ a random selection of products of pt_2 and pt_3?

Submitted by support on Wed, 2011-11-16 19:53

Hi Marco,

It looks like Multisite is going to become more configurable in future versions of WordPress but I see your dilemma in terms of not (at least the best of my knowledge) being able to have a single WordPress installation with main site at

www.example.com

and multi-site additional entries at

www.example.com/multisite2/
www.example.com/multisite3/

So on that basis I would agree with standalone Price Tapestry in /pt_2/ and /pt_3/ and you should still be able to use the plugin in WordPress at the top level with a small modification to enable an override of $config_databaseTablePrefix within the shortcode. To do this, look for the following code at line 519 of pto.php:

        case "debug":

...and REPLACE with:

        case "prefix":
          $pto_config_databaseTablePrefix = $v;
          break;
        case "debug":

Next, you could add a mod to support random featured products; so in pto_featured.php look for the following code at line 36:

  if ($section)
  {
    $sql = "SELECT * FROM `".$pto_config_databaseTablePrefix."featured` WHERE name LIKE '".$wpdb->escape($section)."/%' ORDER BY sequence";
  }

...and REPLACE with:

  if ($section)
  {
    if ($section=="random")
    {
      $sql = "SELECT name,1 AS sequence FROM `".$pto_config_databaseTablePrefix."products` LIMIT 3";
    }
    else
    {
      $sql = "SELECT * FROM `".$pto_config_databaseTablePrefix."featured` WHERE name LIKE '".$wpdb->escape($section)."/%' ORDER BY sequence";
    }
  }

With both the above in place, you could then use on the same page:

[pto prefix="pt_1_" featured="random"]
[pto prefix="pt_2_" featured="random"]

Hope this helps!
Cheers,
David.

Submitted by lisbali12 on Tue, 2012-10-02 14:26

Hi David,

I'm trying to do the same as Marco but have noticed the code (at least in pto.php) has changed since the original post. I now find 'case "debug":' at line 519 rather than 172. Is this the same snippet that needs replacing as per the above or will I need to do something different to enable an override of $config_databaseTablePrefix in the shortcode?

Many thanks in advance.

Best,

Lis

Submitted by support on Tue, 2012-10-02 14:31

Hi Lis,

Spot on - i'll update the original reply above for the benefit of other users.

Cheers,
David.
--
PriceTapestry.com

Submitted by lisbali12 on Thu, 2012-10-11 14:43

Thanks David.

I'm struggling a bit with this, I wonder if you could help me work it out!

I have a large number of product categories with multiple sub-categories. In order to create sub-categories for each of my categories, I have decided to go down the multiple PT installation route. I now have 9 seperate installations each installed in a sub-folder - so www.example.com/pt_1, www.example.com/pt_2, etc.

pt_1 handles the feeds for all but pt_3 which has a seperate set, and this seems to work fine.

What I'd like is to be able to use a static wordpress page for each sub-category (i.e. each category within each installation) and to insert shortcodes for each one so that all the products from a specific category within a specific installation are pulled (e.g. [pto category="Category Name" prefix="pt_3_"]

I have a single wordpress site without multisite enabled and just the one price tapestry plugin.

Is this possible without using multisite? I've tried using the above instructions but this doesn't work for me and I just can't quite get my head around it! Particularly I'm struggling with just having the one plugin for all nine installs and what settings to enter (specifically for the BASE HREF and Install Path).

So grateful for any light you could shed on this.

Many thanks as always,

Lis

Submitted by support on Fri, 2012-10-12 09:14

Hi Lis,

There are number of plugin variables that would need to be modified by way of the "prefix" attribute, which can be made to work but the main issue would be how the rewritten clean product / merchant / category / brand pages would appear.

The rewrite rules are inserted into Wordpress' built in re-write table and is only updated when a change in the configuration is detected (e.g. if you change /merchant/ to /shop/ in the PriceTapestry.org configuration.

Could you perhaps give a few example URLs of how you'd ideally like to see it come together, showing the sort of URLs you have in mind for search results from CategoryA, search results from CategoryB, a merchant index from CategoryA etc...

Thanks!
David.
--
PriceTapestry.com

Submitted by lisbali12 on Fri, 2012-10-12 14:06

Thank you David,

That makes total sense.

What I'm thinking is something like this, where my 9 installation examples of pt_1, etc are named as per my 9 main 'categories' e.g. bluewidgets, redwidgets, yellowwidgets, and so on, so that we'd have:

www.example.com/bluewidgets/shopping
www.example.com/bluewidgets/merchant
www.example.com/bluewidgets/category
www.example.com/bluewidgets/brand

www.example.com/redwidgets/shopping etc

and so on for each of the nine installations/'categories'

and then for a search within the bluewidgets, we'd have something like this:

www.example.com/bluewidgets/shopping/?pto_q=xxxxx

and the same again for the redwidgets 'category' www.example.com/redwidgets/shopping/?pto_q=xxxx, etc

Is this do-able within the confines of the single wordpress and plugin installation?

Many thanks again for such great support,

Lis

Submitted by support on Sat, 2012-10-13 08:30

Hi Lis,

It's not entirely straight forward i'm afraid but I think something might be possible by creating a config file that maps the top level /bluewidgets/ folder to a particular Price Tapestry installation - i'll experiment along those lines on my test server. The "brute force" alternative of course would be separate WordPress installations at each of /bluewidgets/, /redwidgets/ etc. (they could use the same theme as your top level WordPress installation and everything would look the same) but I'll look into it for you...

Cheers,
David.
--
PriceTapestry.com

Submitted by lisbali12 on Mon, 2012-10-15 10:44

Thanks David, I really appreciate your help on this - look forward to hearing how you get on.

Best,

Lis