#3 Tier price Plugin, wrong website assignment

open
nobody
None
5
2012-09-20
2012-01-27
bepixeld
No

Wrong website assignment for tier prices if price scope is set to Global.
If price have global scope then tier price website_id must always set to 0.
(Creating tier price In Magento AdminPanel has the same behaviour).
Otherwise tier prices will not shown in product view (Admin and Frontend).
If price is in website scope, we can use website values.
See AdminPanel: System - Configuration - Catalog/Catalog - Price - Catalog Price Scope

Attached file is based on version 0.0.7a.
I tested this Patch in Magento Version 1.6.2 only, but i think it must also work in other versions, because tables and configuration values are same.

Discussion

  • bepixeld

    bepixeld - 2012-01-27

    Patch based on version 0.0.7a

     
  • Sebastien Bracquemont

    thanks for the patch.
    2 remarks:
    - checking for price scope may also be done using getAttrInfo on price attribute. getAttrInfo is forwarded from plugin to engine via magic __call of plugin base class. it gets its data from the catalog_attribute & eav_attribute attribute metadata tables. however i don't know if the result is the same.

    so i would recommend:

    $price_info= $this->getAttrInfo("price")
    this->_priceGlobal=(intval($price_info["is_global"])==1)

    • putting the $this->_priceGlobal initialization code in initialize is better than in processColumnList.

    can you try it & tell me if it works ?

     
  • bepixeld

    bepixeld - 2012-02-01

    ok, i did a little debugging in Magento AdminPanel when creating tier prices.
    It seems that Magento completely ignores the scope settings for price/tier_price in eav_attribute/catalog_attribute tables.
    Only the setting in AdminPanel: System - Configuration - Catalog/Catalog - Price - Catalog Price Scope is used.
    Additional Magento sets tierprice's website_id to 0, when only one store is defined (single store mode).

    Right, putting the initialization code in initialize() is better (i overlooked this funktion).
    New file is attached. Feel free to integrate in your great project.

     
  • Sebastien Bracquemont

    latest svn version of tierpriceprocessor plugin (0.0.8a) (you can download it from svn browse) takes into account your investigations on global price setting. the 0.0.8 already had the "single store" case.
    Can you download it & test ? (just replace the tierpriceimporter.php file in your magmi/plugins/extra/tierprice dir with the svn one)

     
  • bepixeld

    bepixeld - 2012-02-02

    replace the code (line 101):
    if($this->_singlestore==0 || $this->_pricescope==0)
    {
    $wsids=$this->getItemWebsites($item);
    }
    else
    {
    $wsids=array(0);
    }

    with:
    if($this->_singlestore==1 || $this->_pricescope==0)
    {
    $wsids=array(0);
    }
    else
    {
    $wsids=$this->getItemWebsites($item);
    }

    then it works in all cases on my installation.
    Single/Multistore ; scope global/website
    The important thing is: When we have single store or pricescope is global, we must always set tier price scope to 0.
    I hope now it's clear.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks