If this is your first visit, check our documentation. To post, register or login.

Shopmania Datafeed

Started by torvista on 21 Jan 2012, 8:01 AM · Views: 1,296

Results 1 to 2 of 2
21 Jan 2012, 8:01 AM
#1
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,880
Plugin Contributions:
7

Shopmania Datafeed

There does not seem to be any other support thread for this add-on.

Shopmania Datafeed v1.19.

Typo error:

if (STOCK_ALLOW_CHECKOUT == "true") {
                                                                                                  $availability = (STOCK_MARK_PRODUCT_OUT_OF_STOCK != "***") ? STOCK_MARK_PRODUCT_OUT_OF_STOCK : "Out of sock";
```  To
   ```php
   if (STOCK_ALLOW_CHECKOUT == "true") {
                                                                                                  $availability = (STOCK_MARK_PRODUCT_OUT_OF_STOCK != "***") ? STOCK_MARK_PRODUCT_OUT_OF_STOCK : "Out of stock";
``` unless you actually sell hosiery of course!

 
  The v19 code associates a product with the first defined category which may not be what you want. In my view, it should really be associated with the master category. 
  Shopmania told me I was the only one who had mentioned this (!) , so they are not changing it.
  
To use the master category I changed the main query:
```php
$q = "SELECT $cat_table.categories_id, $cat_manuf_table.manufacturers_name, $prod_table.products_model, $prod_table.products_id, $prod_desc_table.products_name, " . $description_field . ", " . $image_field . ", $prod_table.products_price, $prod_table.products_tax_class_id, $prod_table.products_priced_by_attribute, $prod_table.products_quantity
  FROM $prod_table
  LEFT JOIN $prod_desc_table ON ( $prod_table.products_id = $prod_desc_table.products_id AND $prod_desc_table.language_id = '$main_language' )
  LEFT JOIN $cat_prod_table ON $prod_table.products_id = $cat_prod_table.products_id
  LEFT JOIN $cat_table ON $cat_prod_table.categories_id = $cat_table.categories_id
  LEFT JOIN $cat_manuf_table ON $prod_table.manufacturers_id = $cat_manuf_table.manufacturers_id
  WHERE $cat_table.categories_status > 0 AND $prod_table.products_status > 0 " . addslashes($on_stock_cond) . "
  ORDER BY $prod_table.products_id ASC, $cat_table.parent_id DESC" . addslashes($limit_cond);
```  To
```php
$q = "SELECT $prod_table.master_categories_id, $cat_manuf_table.manufacturers_name, $prod_table.products_model, $prod_table.products_id, $prod_desc_table.products_name, " . $description_field . ", " . $image_field . ", $prod_table.products_price, $prod_table.products_tax_class_id, $prod_table.products_priced_by_attribute, $prod_table.products_quantity
  FROM $prod_table
  LEFT JOIN $prod_desc_table ON ( $prod_table.products_id = $prod_desc_table.products_id AND $prod_desc_table.language_id = '$main_language' )
  LEFT JOIN $cat_prod_table ON $prod_table.products_id = $cat_prod_table.products_id
  LEFT JOIN $cat_table ON $cat_prod_table.categories_id = $cat_table.categories_id
  LEFT JOIN $cat_manuf_table ON $prod_table.manufacturers_id = $cat_manuf_table.manufacturers_id
  WHERE $cat_table.categories_status > 0 AND $prod_table.products_status > 0 " . addslashes($on_stock_cond) . "
  ORDER BY $prod_table.products_id ASC, $cat_table.parent_id DESC" . addslashes($limit_cond);

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

16 Aug 2016, 11:16 PM
#2
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,880
Plugin Contributions:
7

Re: Shopmania Datafeed

2016 08 The current version as supplied by Shopmania is version 1.21.

I have just updated it to remove all the obsolete mysql tags etc. for php7, and some other stuff specific to my shop.
I have put it up on Github as is.
Compare it to the stock 1.21 to detail the changes, but it should work fine in any shop.

https://github.com/torvista/Shopmania-datafeed-for-Zen-Cart

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...