2016-08-09 9 views
1

Ich bin mit Magento v1.8 und der folgende Code im Preis eines einfachen ProduktMagento einfaches Produkt Preis nicht nach Änderung aktualisieren

$prodId = 27953; 
$product = Mage::getModel('catalog/product')->load($prodId); 
$price = $product->getPrice(); 

Der Preis kommt durch feine zu ziehen, aber wenn das I-Update Der Preis des Produkts im Magento Admin, der aktualisierte Preiswert kommt im obigen Code nicht durch. Der alte Preis wird zurückgegeben.
Ich habe versucht Magento Cache zu löschen und Neuindizierung alles, um den Shell-Befehl mit ...

php indexer.php --reindexall 

Wenn ich var_dump ($ Produkt) ich das der neue Preis sehen (75 £) in den geschützten ‚_defaultValues ​​ist 'Array aber der alte Preis (£ 200) ist in der geschützten' _data 'Array

Kann mir jemand sagen, warum der Preis nicht aktualisiert?

> object(Mage_Catalog_Model_Product)[54] 
>  protected '_defaultValues' => 
>  array (size=28) 
>  'name' => string 'Artist Edition - Guy Archard' (length=28) 
>  'meta_title' => null 
>  'meta_description' => null 
>  'image' => string 'no_selection' (length=12) 
>  'small_image' => string 'no_selection' (length=12) 
>  'thumbnail' => string 'no_selection' (length=12) 
>  'url_key' => string 'artist-edition-guy-archard' (length=26) 
>  'url_path' => string 'artist-edition-guy-archard.html' (length=31) 
>  'page_layout' => null 
>  'options_container' => string 'container1' (length=10) 
>  'msrp_enabled' => string '2' (length=1) 
>  'msrp_display_actual_price_type' => string '4' (length=1) 
>  'price' => string '75.0000' (length=7) 
>  'special_price' => null 
>  'msrp' => null 
>  'status' => string '1' (length=1) 
>  'visibility' => string '4' (length=1) 
>  'tax_class_id' => string '0' (length=1) 
>  'description' => null 
>  'short_description' => null 
>  'meta_keyword' => null 
>  'custom_layout_update' => null 
>  'special_from_date' => null 
>  'special_to_date' => null 
>  'news_from_date' => null 
>  'news_to_date' => null 
>  'custom_design_from' => null 
>  'custom_design_to' => null 
>  protected '_data' => 
>  array (size=62) 
>  'entity_id' => string '27953' (length=5) 
>  'entity_type_id' => string '4' (length=1) 
>  'attribute_set_id' => string '25' (length=2) 
>  'type_id' => string 'simple' (length=6) 
>  'sku' => string 'MF-ARTIST-GUY-ARCHARD' (length=21) 
>  'has_options' => string '1' (length=1) 
>  'required_options' => string '0' (length=1) 
>  'created_at' => string '2016-08-08 17:33:06' (length=19) 
>  'updated_at' => string '2016-08-08 18:35:40' (length=19) 
>  'absolute_price' => string '0' (length=1) 
>  'absolute_weight' => string '0' (length=1) 
>  'sku_policy' => string '0' (length=1) 
>  'name' => string 'Artist Edition - Guy Archard' (length=28) 
>  'meta_title' => string 'Guy Archard' (length=11) 
>  'meta_description' => string 'Norway' (length=6) 
>  'image' => string '/M/F/MF-ARTIST-GUY-ARCHARD_19.jpg' (length=33) 
>  'small_image' => string '/M/F/MF-ARTIST-GUY-ARCHARD_19.jpg' (length=33) 
>  'thumbnail' => string '/M/F/MF-ARTIST-GUY-ARCHARD_19.jpg' (length=33) 
>  'url_key' => string 'artist-edition-guy-archard' (length=26) 
>  'url_path' => string 'artist-edition-guy-archard.html' (length=31) 
>  'custom_design' => null 
>  'page_layout' => null 
>  'options_container' => string 'container2' (length=10) 
>  'country_of_manufacture' => null 
>  'msrp_enabled' => string '2' (length=1) 
>  'msrp_display_actual_price_type' => string '4' (length=1) 
>  'gift_message_available' => string '0' (length=1) 
>  'price' => string '200.0000' (length=8) 
>  'special_price' => null 
>  'weight' => null 
>  'msrp' => null 
>  'status' => string '1' (length=1) 
>  'is_recurring' => string '0' (length=1) 
>  'visibility' => string '4' (length=1) 
>  'enable_googlecheckout' => string '1' (length=1) 
>  'tax_class_id' => string '0' (length=1) 
>  'makeframe_mkyours_shape' => string '1730' (length=4) 
>  'makeframe_mkyours_mldstyle' => string '1865' (length=4) 
>  'makeframe_mkyours_glazing' => string '1729' (length=4) 
>  'makeframe_mkyours_printchoice' => string '1804' (length=4) 
>  'makeframe_mkyours_mldcolour' => string '1812' (length=4) 
>  'description' => null 
>  'short_description' => null 
>  'meta_keyword' => null 
>  'custom_layout_update' => null 
>  'special_from_date' => null 
>  'special_to_date' => null 
>  'news_from_date' => null 
>  'news_to_date' => null 
>  'custom_design_from' => null 
>  'custom_design_to' => null 
>  'image_label' => null 
>  'small_image_label' => null 
>  'thumbnail_label' => null 
>  'group_price' => 
>   array (size=0) 
>   empty 
>  'group_price_changed' => int 0 
>  'media_gallery' => 
>   array (size=2) 
>   'images' => 
>    array (size=2) 
>    ... 
>   'values' => 
>    array (size=0) 
>    ... 
>  'tier_price' => 
>   array (size=0) 
>   empty 
>  'tier_price_changed' => int 0 
>  'stock_item' => 
>   object(Mage_CatalogInventory_Model_Stock_Item)[296] 
>   private '_minSaleQtyCache' => 
>    array (size=0) 
>    ... 
>   protected '_qtyIncrements' => null 
>   protected '_eventPrefix' => string 'cataloginventory_stock_item' (length=27) 
>   protected '_eventObject' => string 'item' (length=4) 
>   protected '_productInstance' => 
>    &object(Mage_Catalog_Model_Product)[54] 
>   protected '_customerGroupId' => null 
>   protected '_processIndexEvents' => boolean true 
>   protected '_resourceName' => string 'cataloginventory/stock_item' (length=27) 
>   protected '_resource' => null 
>   protected '_resourceCollectionName' => string 'cataloginventory/stock_item_collection' (length=38) 
>   protected '_cacheTag' => boolean false 
>   protected '_dataSaveAllowed' => boolean true 
>   protected '_isObjectNew' => null 
>   protected '_data' => 
>    array (size=33) 
>    ... 
>   protected '_hasDataChanges' => boolean true 
>   protected '_origData' => 
>    array (size=28) 
>    ... 
>   protected '_idFieldName' => string 'item_id' (length=7) 
>   protected '_isDeleted' => boolean false 
>   protected '_oldFieldsMap' => 
>    array (size=2) 
>    ... 
>   protected '_syncFieldsMap' => 
>    array (size=4) 
>    ... 
>  'is_in_stock' => string '1' (length=1) 
>  'is_salable' => string '1' (length=1) 

Antwort

2

Magento Produkt Preis Umfang ist auf Website-Ebene. Von dem, was Sie sagen, ich denke, Sie haben den neuen Preis auf der Standard-Store-Ebene, anstatt es auf Website-Ebene setzen. Auf der Website-Ebene haben Sie also immer noch den alten Preis. Deshalb sehen Sie immer noch alten Preis für das Produkt.

Um dies zu beheben, müssen Sie entweder den Preis auf der Website auf den neuen Preis ändern oder auf Ihrer Website die Option "Standard verwenden" auswählen, um den neuen Preis vom Standardspeicher zu erhalten. Sie können

P. S „Wählen Sie Store View“ Drop-Down bei, indem auf Ihre Website Website levele Preise ändern: Denken Sie immer daran, die reindexer nach dem Ändern Preis

+1

Sie sind ein Stern zu laufen! – MakkyNZ

+0

Fall auf die gleiche Falle, danke – BatMUD

Verwandte Themen