Jump to content

Module Prisjakt


ruilong
 Share

Recommended Posts

I got it all solved before I got any answers so I change this topic :)

Here is a module for "prisjakt.se" a price index service in sweden.

The module will create a simple "text file" that can be read by price index servers so that your products will get indexed.
should be easy enough to make alterations on this for support of xml files or similar.

just point the servers to www.yourdomain.com/prisjakt.php

Enjoy

Updated with new file to list ALL products.

prisjakt.php

Share this post


Link to post
Share on other sites

Thank you, but it should be mentioned that the following line should be changed if one wants more then 10 products in the file

$products = $productClass->getProducts($lang, 0, 10, 'name', 'ASC', false);
$products = $productClass->getProducts($lang, 0, 100000, 'name', 'ASC', false);

Also it mght be a good idea to change tab to pike (|) for easier use with other tools

Share this post


Link to post
Share on other sites

Or use NULL instead of a number and just get them all......

$products = $productClass->getProducts($lang, 0, NULL, ‘name’, ‘ASC’, false);



Paul



thanks for the imput, I changed it to null instead.


JONAS: the use of tab instead of pike is because that is the standard for this service, but if it needs to be adapted to other services then that is not so hard to change :)

Share this post


Link to post
Share on other sites

Here are some minor changes (new lines, product numbers etc)

echo "SKU|Name|Price|Category|Product URL|Graphic URL|In stock\n";


echo ($product['reference'])."|".
                ($product['name'])."|".
                number_format(Tools::convertPrice($price, $currency), 2, '.', '')."|".
                $category->name[1]."|".
                curPageURL().'/product.php?id_product='.$product['id_product']."|". //PRINT PRODUCT DIRECT URl
                curPageURL()._THEME_PROD_DIR_.$product['id_product']."-".$imageUrl['id_image']."-large.jpg"."|". //PRINT IMAGE URL {$img_prod_dir}{
$cover.id_image}-large.jpg
                $product['quantity']."\n"; //IN STOCK STATUS



I tried to make the URL:S har the user friendly rewrites but failed on products that have or dont have a ean13 value. There must be an easier way then this to get the friendly url

curPageURL()."/".($product['id_product'])."-".($product['link_rewrite'])."-".($product['ean13']).".html"."|".



I have used pike with prisjakt in the past without any problems but its no big deal

Share this post


Link to post
Share on other sites

  • 1 year later...
  • 1 year later...
  • 3 weeks later...
  • 3 months later...
  • 1 year later...
  • 4 weeks later...
  • 2 weeks later...

Hello! I downloaded this .php-file and then uploaded it to my domain through FileZilla. When I go to the domain "www.example.com/prisjakt.php" (in my case - www.phoneaccessories.se/prisjakt.php) it only shows this:

"SKU Name Price Category Product URL Graphic URL In stock"

 

Is this right or what do I have to do to get this to work? Need help fast! :)

 

Can I export my price file? And if I can how do I do that?

 

Med vänlig hälsning, Robin Stattin.

Share this post


Link to post
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More