Updated 2025-12-08 13:21:43 +02:00
Updated 2025-12-07 14:13:09 +02:00
Updated 2025-12-02 14:15:17 +02:00
Updated 2025-11-25 11:00:29 +02:00
Updated 2025-10-31 12:43:02 +02:00
Updated 2025-10-01 13:22:18 +03:00
Updated 2025-09-26 13:15:21 +03:00
Updated 2025-09-23 08:59:46 +03:00
Updated 2025-09-07 12:50:11 +03:00
Updated 2025-09-05 21:36:57 +03:00
Updated 2025-07-17 19:42:18 +03:00
Initial implementation of the Google Automated Discounts (googleautodiscount) module for PrestaShop.
This module provides functionality to integrate with Google Merchant Center's automated discount promotions.
Key features in this initial version:
- Configuration page to store Google Merchant Center ID and JWKS URI for public key retrieval.
- Intercepts and processes the `pv2` (Promotion V2) token from Google in the `displayHeader` hook.
- Validates the JWT using PrestaShop's JWTFactory and public keys fetched from the configured JWKS URI.
- Includes a basic JWK to PEM conversion for RSA keys.
- Validates token signature, expiration, and merchant ID against configuration.
- Creates a PrestaShop Cart Rule (coupon) based on discount information extracted from the `pv2` token (percentage or fixed amount).
- Stores the generated coupon code in an encrypted PrestaShop cookie with a 4-day lifetime.
- Displays the discount code and the new discounted price on the product page (`displayProductAdditionalInfo` hook) if a valid coupon exists in the cookie.
- Automatically applies the coupon to the shopping cart when items are added (`actionCartSave` hook).
- Includes basic logging for key operations and errors.
- Provides a template for displaying discount information on the product page.
- Module structure follows PrestaShop best practices for 1.7.8+/8.x.
Further work may include more robust JWK handling, advanced cart rule configurations based on token claims, and refined UI elements.
Updated 2025-05-08 19:48:19 +03:00
Updated 2025-03-22 13:38:06 +02:00
Updated 2025-01-07 15:54:25 +02:00
Updated 2024-12-19 08:16:21 +02:00
Updated 2024-12-10 20:22:36 +02:00