File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -55,14 +55,23 @@ abstract protected function _getDuplicateErrorMessage();
55
55
/**
56
56
* Retrieve websites currency rates and base currency codes
57
57
*
58
+ * @param int|null $websiteId
58
59
* @return array
59
60
*/
60
- protected function _getWebsiteCurrencyRates ()
61
+ protected function _getWebsiteCurrencyRates ($ websiteId = null )
61
62
{
62
63
if (is_null ($ this ->_rates )) {
63
64
$ this ->_rates = array ();
64
65
$ baseCurrency = Mage::app ()->getBaseCurrencyCode ();
65
- foreach (Mage::app ()->getWebsites () as $ website ) {
66
+
67
+ if (is_numeric ($ websiteId )) {
68
+ $ website = Mage::app ()->getWebsite ($ websiteId );
69
+ $ websites = [$ website ];
70
+ } else {
71
+ $ websites = Mage::app ()->getWebsites ();
72
+ }
73
+
74
+ foreach ($ websites as $ website ) {
66
75
/* @var Mage_Core_Model_Website $website */
67
76
if ($ website ->getBaseCurrencyCode () != $ baseCurrency ) {
68
77
$ rate = Mage::getModel ('directory/currency ' )
@@ -189,7 +198,7 @@ public function validate($object)
189
198
*/
190
199
public function preparePriceData (array $ priceData , $ productTypeId , $ websiteId )
191
200
{
192
- $ rates = $ this ->_getWebsiteCurrencyRates ();
201
+ $ rates = $ this ->_getWebsiteCurrencyRates ($ websiteId );
193
202
$ data = array ();
194
203
$ price = Mage::getSingleton ('catalog/product_type ' )->priceFactory ($ productTypeId );
195
204
foreach ($ priceData as $ v ) {
You can’t perform that action at this time.
0 commit comments