Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cambios Multicurrency Prestashop #258

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

ogomezba
Copy link
Contributor

NOTA: La función getMultiprice()

    public static function getMultiprice($productId, $includeTaxes, $currencies, $variantId = null)
    {
        $multiprices = [];
        $price = self::getPrice($productId, $includeTaxes, $variantId);
        $onsale_price = self::getOnsalePrice($productId, $includeTaxes, $variantId);

        foreach ($currencies as $currency) {
            if ($currency['deleted'] == 0 && $currency['active'] == 1) {
                $convertedPrice = \Tools::convertPrice($price, $currency);
                $convertedOnsalePrice = \Tools::convertPrice($onsale_price, $currency);

                $multiprices[] = 'price_' . $currency['iso_code'] . '=' . $convertedPrice;

                if ($convertedPrice != $convertedOnsalePrice) {
                    $multiprices[] = 'sale_price_' . $currency['iso_code'] . '=' . $convertedOnsalePrice;
                }
            }
        }

        return implode('/', $multiprices);
    }

produce el formato temporal acordado price_EUR=33/sale_price_EUR=25/price_GBP=11... para el campo df_multiprice.

@ogomezba ogomezba self-assigned this Oct 29, 2024
@ogomezba ogomezba linked an issue Oct 29, 2024 that may be closed by this pull request
3 tasks
@@ -76,6 +76,7 @@ public static function setDefaultShopConfig($shopGroupId, $shopId)
\Configuration::updateValue('DF_GS_DESCRIPTION_TYPE', DoofinderConstants::GS_SHORT_DESCRIPTION, false, $shopGroupId, $shopId);
\Configuration::updateValue('DF_FEED_MAINCATEGORY_PATH', false, false, $shopGroupId, $shopId);
\Configuration::updateValue('DF_GS_IMAGE_SIZE', key(DfTools::getAvailableImageSizes()), false, $shopGroupId, $shopId);
\Configuration::updateValue('DF_MULTIPRICE_ENABLED', true, false, $shopGroupId, $shopId);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ogomezba tengo una duda con esto, al meter este valor con shopGroupId y con shopId entiendo que esto es una entrada por cada tienda que haya (para el caso de multi-tienda) pero esto es realmente así? es que no me suena que el campo DF_REGION por ejemplo cuando hago la consulta en base de datos esté duplicado, pero igual es que simplemente no he prestado atención. Pero quería confirmarlo contigo antes que darlo por hecho, solo por asegurar que vamos a tener uno de esto por cada shop

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hola @sofia-doofinder ! Sí, como parte de las pruebas he estado revisando que al final tuviéramos esta configuración por store y así era. Respecto a lo de la DF_REGION que comentas, para mi prestashop actual multistore tengo
image
por lo que en principio está todo en orden.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

genial! muchas gracias por la confirmación

Copy link
Contributor

@davidmolinacano davidmolinacano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🏆

src/Entity/DfProductBuild.php Show resolved Hide resolved
@ogomezba ogomezba force-pushed the ogomezba/doofinder-prestashop/237/cambios-instalacion-multicurrency branch from d25458a to 504e74b Compare October 30, 2024 15:07
@ogomezba ogomezba force-pushed the ogomezba/doofinder-prestashop/237/cambios-instalacion-multicurrency branch from 504e74b to fb54367 Compare November 18, 2024 07:50
Oscar Gomez added 3 commits November 18, 2024 08:54
During update on save, the expected value for the multiprice is the map
itself and not the CSV format for the multiprice.

In addition, we should avoid sending a "" as multiprice because it
causes problems in doofAPI.
@ogomezba ogomezba force-pushed the ogomezba/doofinder-prestashop/237/cambios-instalacion-multicurrency branch from 07e5c23 to c82c679 Compare November 18, 2024 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Est:5] [Prestashop][Multi-Currency] - Cambios en instalación
3 participants