Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author wpkey10

    (@wpkey10)

    This is a known issue with the actual plugin.

    If we’ll continue the development we’ll need to completely rewrite it to work with the last version of PS.

    I can’t say right now if we’ll continue or not.

    I got it to work with PrestaShop 1.5.4.1 and WordPress 3.5.2.

    In the file wp-prestashop-cs.php:

    There are two lines (93, 140) with

    SELECT i.position FROM ps_product p

    CHANGE TO

    SELECT i. id_image FROM ps_product p

    NOTE: “position” had back ticks around it. Replace “position” with “id_image” – I can’t get the inline back ticks to display properly here.

    There are two lines (101,148) with:

    $image_path = $image_folder . "/". $product_id . "/".$id_image."/" . $product_id.$id_image."-" . $image_size."_default.jpg";

    CHANGE TO

    $ps_image="";
    $splits=strlen ( $id_image );
    	for ($ii = 0; $ii < $splits; $ii++)
    		{
    		$ps_image.=substr($id_image, $ii,1)."/";
    		}
    $image_path = $image_folder . "/".$ps_image.$id_image."-" . $image_size."_default.jpg";

    Not only has the directory system changed for images, but maybe the way they are stored in the database too. I started with a clean install of PrestaShop 1.5.4.1

    It works for me, but the following lines (103,150) where there’s a short “if” to determine whether the url exists would likely still produce another bogus image link

    if(!url_exists($image_path)){
    $image_path = $image_folder . "/". $product_id ."/" . $product_id."-" . $image_size."_default.jpg";

    So like I said, these changes got the plugin working for me, however the page loading hangs noticeably while fetching those images and links and product names. The query for returning the image id seems a bit overzealous. The Prestashop table “ps_image” contains the image id and the product id, which is all you need for the actual image instead of three LEFT JOINs to other tables. Prestashop runs slow in general on my host (Hostgator) Maybe this plugin would work better if it was an AJAX call that waited till after the page loaded.

    Plugin Author wpkey10

    (@wpkey10)

    @kilwag:

    Thanks for your suggestions. We’ll release a better plugin where will allow the user (back-end in WP admin) to chose what products he wants to promote and import them into WP as custom post types. The random displaying will be done from WP DB so no more loading and searching remotely on Prestashop DB or “if image exist”.

    Hmm. I imagine that would be faster, but if you if you add or delete products in Prestashop, you’d have to re-import into WordPress.

    Plugin Author wpkey10

    (@wpkey10)

    It could be a problem, yes. I will think about this and come up with a solution to avoid broken links in WP. Thanks.

    Thread Starter d4b

    (@d4b)

    @wpkey10: when ?

    Plugin Author wpkey10

    (@wpkey10)

    @d4b: I can’t say right now when it will be ready. Please favorite our plugin and check from time to time to see if there is an update.

    Thread Starter d4b

    (@d4b)

    Less is more, week, month, year?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘PrestaShop new storage system for product images’ is closed to new replies.