We are on social networks
Go to contacts
0
Wishlist
0
Compare
Module catalog
0
0
All about product
Description
Specification
Reviews 0
3.x
Google Automated Discounts for OpenCart
Google Automated Discounts for OpenCart

Google Automated Discounts for OpenCart

0 Leave a review
Product Code: 53267
The add-on was developed by Ocmodules.in.ua studio. Author: IHOR1989. Profile: OpenCartForum
In Stock
25 $
Want to know when the price changes?
Admin page
Compatible with OpenCart 3.x
Compatible with OpenCart 3.x

The module has been tested on OpenCart 3.x. Operation on other versions is not guaranteed.

Created in Ukraine
Created in Ukraine

Sales and technical support of the module for online stores are not provided in the Russian Federation and the Republic of Belarus.

Open source
Open source

The module code is unencrypted, without ionCube or obfuscation. You can freely view and modify the code.

Description

The Google Automated Discounts extension integrates OpenCart with the Google Merchant Center Automated Discounts program. It supports two operating modes: calculating minimum allowed prices locally and sending them through a supplemental XML feed, or accepting a ready personalised price calculated by Google Merchant Center.

The extension receives a personalised price from the signed pv2 parameter, validates it, and applies it on product pages, product listings, the cart, and checkout. The regular product price and special price are not changed in the database: the personalised offer is stored only for the relevant visitor.

The solution supports multiple stores, currencies, and Merchant Center accounts. A separate channel can be created for each required combination, with its own Merchant Center ID, currency, Offer ID field, and pricing restriction source.

Two operating modes

The pricing restriction source can be selected separately for every channel:

  • Extension settings — the extension determines which products participate in the program, calculates their minimum allowed prices, and generates a supplemental XML feed containing auto_pricing_min_price and, when a product cost is available, cost_of_goods_sold
  • Google Merchant Center — products, gross margin, and maximum discount are configured directly in Google. The extension’s supplemental minimum-price XML feed is not used, and the personalised price is accepted from the signed JWT without rechecking it against local rules or a locally calculated minimum price

In both modes, the extension validates the cryptographic signature, Merchant Center ID, Offer ID, currency, expiration time, and matching product. The received price must be positive and lower than the product’s current price. The only difference is where product eligibility and the permitted price floor are configured.

Google Merchant Center mode does not replace the store’s primary product feed. Google must still receive the main product data and valid Offer IDs from the standard product data source.

How Automated Discounts work

  1. The administrator creates a channel for the required store, Merchant Center account, and currency
  2. A pricing restriction source is selected: extension settings or Google Merchant Center
  3. In local mode, the administrator configures product eligibility and minimum-price rules, then CRON generates a supplemental XML feed
  4. In Google Merchant Center mode, products, margin, and maximum discount are configured in Google without using the extension’s supplemental feed
  5. Google determines a personalised price and sends it to the shopper as a signed JWT in the pv2 GET parameter
  6. The extension validates the ES256 signature, Merchant Center ID, Offer ID, product, currency, price, and expiration time
  7. In local mode, product eligibility and compliance with the calculated minimum price are also validated
  8. After successful validation, the personalised price appears in the storefront and is carried into the cart and order

The personalised price is retained for at least 30 minutes on the product page and for 48 hours in the cart. It does not become the product’s public price and is not shown to other shoppers.

Extension features

  • Separate channels for different stores, Merchant Center accounts, and currencies
  • A separate pricing restriction source for every channel
  • Local pricing rules with a supplemental minimum-price XML feed
  • Acceptance of Google prices without local minimum-price validation
  • Operation without the extension’s supplemental XML feed when products, margin, and maximum discount are configured in Merchant Center
  • Static XML feeds in Google Merchant Center format
  • A custom file name for every XML feed
  • Protected feed generation using a secret CRON key
  • Selection of the OpenCart field used as Offer ID
  • Product eligibility management by category, manufacturer, and individual product
  • Product inclusion and exclusion rules
  • Filtering by current price and active special price
  • Minimum-price calculation as a maximum discount from the current price
  • Minimum-price calculation as a markup on product cost
  • Individual settings directly in the OpenCart product form
  • Validation of signed Google personalised prices using ES256
  • Personalised pricing on the storefront, in the cart, and in orders
  • Administrative labels for production and test Google orders
  • Local test links for checking the entire flow before connecting Merchant Center
  • Statistics for active prices and related orders
  • Automatic cleanup of expired records and old history
  • Logging of reasons for accepting or rejecting a personalised price
  • Ukrainian, English, and Russian interfaces

Channels and Offer ID

A channel combines the settings of one store, Merchant Center account, and currency. Each channel has a name, store, Merchant Center ID, currency, Offer ID, pricing restriction source, XML file name, and status.

Offer ID can be read from the standard OpenCart fields: product_id, model, sku, upc, ean, jan, isbn, or mpn.

The selected value must exactly match the ID of the same offer in the primary Merchant Center product data source. Otherwise, the extension cannot accept a personalised price for that product.

Local pricing rules

Pricing rules are used only when Extension settings is selected as the pricing restriction source. In Google Merchant Center mode, local rules, product cost, and manually entered minimum prices do not restrict the offer received in the signed JWT.

Rules are checked from the lowest sort order to the highest. The first matching rule is used for the product.

  • Allow or deny participation — includes or excludes matching products
  • Categories, manufacturers, and products — define the scope of a rule
  • Special price condition — all products, only products with a current special, or only products without one
  • Price from and to — optional current-price limits
  • Method and value — maximum discount from current price or markup on product cost

Categories, manufacturers, and individual products in the same rule are combined: matching any selected list is sufficient. When all lists are empty, the rule applies to every product in the channel.

Minimum-price calculation methods

  • Maximum discount from current price — the minimum price equals the current price minus the specified percentage. Product cost is not required
  • Markup on product cost — the minimum price equals product cost plus the specified percentage. The cost field is required for this method

When product cost is provided, the extension sends it as cost_of_goods_sold and does not allow the local minimum price to fall below cost. If cost equals zero, this attribute is omitted from the XML feed.

Product form settings

The modification adds product cost, a manual automated minimum price, and an Automated Discounts participation mode to the standard OpenCart product form. These settings are used in local mode and take priority over automatic rules.

The product cost field can be hidden if the store already uses a compatible purchasing extension that stores data in the same cost field.

Static XML feed and CRON

The static XML feed is used in local pricing restriction mode. Each channel creates a separate XML file in the price directory. Google receives a ready file without running expensive SQL queries on every request to the feed URL.

  • One CRON request completely rebuilds the selected feed
  • The CRON URL is protected by a shared secret key
  • A ready URL and crontab command are displayed for every channel
  • File size, modification date, and generation statistics are available in the settings
  • A product without cost can provide Offer ID and auto_pricing_min_price
  • When cost is provided, cost_of_goods_sold is also included

When Google Merchant Center is selected as the pricing restriction source, the XML feed generated by the extension does not need to be connected. Eligibility, gross margin, and maximum discount are configured directly in Google.

Testing personalised prices

The built-in testing tab creates a temporary link with a test personalised price and allows the entire flow to be checked before receiving a production test link from Google.

In local mode, the test price must be below the current price and not below the calculated minimum. In Google Merchant Center mode, the local minimum is not checked, but the price must still be positive and below the current product price.

For testing, the extension creates a separate ES256 key pair in the protected storage directory. Local testing does not alter the official Google public key and does not replace Merchant Center production validation.

Security validation

  • ES256 cryptographic signature validation
  • Merchant Center ID, Offer ID, and matching product validation
  • Currency, expiration time, and personalised price validation
  • Comparison with the product’s current price
  • Local minimum-price validation when the channel uses extension rules
  • Binding of local test links to the visitor’s IP address
  • Acceptance and rejection logging without storing the JWT itself

The official Google ES256 public key is already included in the settings. It is shared by Automated Discounts integrations and does not need to be created by the store administrator.

Personalised price display

The personalised price is integrated into product pages, categories, manufacturer pages, search, specials, standard product modules, the cart, standard checkout, and the administrative order page.

Quick-order extensions using the standard OpenCart Cart and addOrder mechanisms receive the personalised price automatically. Extensions that read prices or create orders using direct SQL queries may require a separate adaptation.

Order labels

When a personalised price is used at checkout, the extension links it to the order. The administrator sees a Google Automated Discounts label, while locally generated test orders receive a separate test label.

SEO URLs and the pv2 parameter

An SEO extension, CDN, or redirect from index.php to an SEO URL must not remove the pv2 GET parameter. When SeoPro or another URL modification is used, pv2 must be added to the permitted parameter list. Pages containing a personalised price must not be stored in a shared full-page cache.

Multistore and currencies

Each channel uses a specific OpenCart store and one active currency. Rules are isolated between channels, allowing different conditions for individual countries, currencies, storefronts, or Merchant Center accounts.

Performance

  • Static XML files instead of feed generation on every Google request
  • Selection of only the product data required for feed generation
  • Indexes on extension tables for key operations
  • Batch application of personalised prices to product result sets
  • Use of standard OpenCart Currency, Tax, Cart, Events, and DB APIs
  • No external API requests while storefront pages are loading

Theme and third-party extension compatibility

The main pricing logic works through standard OpenCart product models, cart, events, and order mechanisms. A targeted adaptation may be required when a theme or third-party extension reads prices through direct SQL queries, uses a custom cart, or creates orders without the standard addOrder method.

Open source code and independence

The extension code is not encoded or obfuscated. It does not use licence servers, telemetry, or remote libraries. JWT validation, pricing rules, personalised price storage, and XML generation are performed directly on the store server.

System requirements

  • OpenCart 3.0.3.x
  • PHP 7.4–8.5
  • PHP OpenSSL with ES256 support
  • MySQL or MariaDB
  • A Google Merchant Center account with access to Automated Discounts
  • Purchase conversion tracking with cart data
  • For local mode: permission to write XML files to the price directory and the ability to configure recurring CRON

Installation

  1. Install the archive through Extensions / Installer
  2. Refresh the cache in Extensions / Modifications
  3. Install and open Google Automated Discounts under Feeds
  4. Enable the extension and create a channel for the required store, Merchant Center account, and currency
  5. Verify the Offer ID field and select the pricing restriction source
  6. For local mode, configure rules, run CRON, and connect the XML file as a supplemental Merchant Center data source
  7. For Google Merchant Center mode, configure products, gross margin, and maximum discount directly in Google
  8. Check both local and production test links

The extension does not directly modify OpenCart core files. Integration is implemented using standard OpenCart Events and OCMOD.

Important notes

The extension does not automatically enrol a store in Google Automated Discounts. Program availability, Merchant Center configuration, and final store approval are determined by Google.

The primary Merchant Center product data source must contain products with correct Offer IDs in either operating mode. The Offer ID selected in the extension must exactly match the corresponding offer identifier in Google’s primary product data source.

In local mode, the extension XML is used as a supplemental source for Automated Discounts attributes. In Google Merchant Center mode, this supplemental file is not required because pricing restrictions are configured directly in Google.

The extension does not replace analytics and does not send purchase conversions to Google. A separate Google Analytics, Google Ads, or compatible integration is required for this purpose.

Licence

The licence covers one domain and its subdomains.

Specifications
Main characteristics
Current module version 1.2
Compatibility OpenCart 3.x
ocStore 3.x
Localization Ukrainian
English
Russian
Support is provided in the following languages Ukrainian
English
Russian
License type For one domain + its subdomain
Activation method Without activation
Contacting the developer server No
Ioncube Loader No
Supported PHP version PHP 7.0-7.4
PHP 8.0-8.3
Reviews

There are no reviews for this product, be the first to leave your review.