Jump to content

Prestashop products in Wordpress


Recommended Posts

Hello all,

I would like ask you how to insert images from PS1.4.6 new filesystem in other CRM.

im using wordpress for blog about my shop and I would like add here some links to items from my store.

 

see at blog.forseti-fashion.cz - right top corner, here are 3 links to clothes from my store, but I canot add here images.

 

now Im using this code:

$image_path = $image_folder . "/" . $product_id . "/" . $attribute_id . "/" . $product_id . $attribute_id. "-" . $image_size;

 

this is possible use for first 10 products, but If I have more path is wrong.

all other links are correct.

 

Some ideas?

Link to comment
Share on other sites

You should be able to include at the top of your pages to load Prestashop's functions (changing the directory as required, so if you were using /blog/ you'd have to have '../config/config.inc.php' and '../init.php' etc).

 

require(dirname(__FILE__).'/config/config.inc.php');
require(dirname(__FILE__).'/init.php');

 

This then means you'd be able to use

Link::getImageLink($name, $ids, $type = NULL)

from the Link class (/classes/Link.php line 162), which will return your image urls based on your rewrite rules set in Prestashop.

 

I haven't tested this but it should work!

 

Mark

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...