Skip to content

Instantly share code, notes, and snippets.

@seigieu
Created June 8, 2020 10:57
Show Gist options
  • Save seigieu/5e0da2c263b8bda96b834d5c3ba1f805 to your computer and use it in GitHub Desktop.
Save seigieu/5e0da2c263b8bda96b834d5c3ba1f805 to your computer and use it in GitHub Desktop.
PriceWars II Custom function offer splitter
<?php
// Custom Function dla modułui PriceWars II
// https://pl.seigi.eu/modul-prestashop/pricewars2.html
// Skrypt pozwala na automatycznie rozdzielenie oferty na 2 XML
function pricewars2_product(\pricewars2\product $product, $id_xml, $id_lang, $service, $settings, $module){
if($id_xml == 1 && $product->id_presta <= 9000){
throw new \pricewars2\pricewarsSkipException('Produkt ze starej oferty');
}
if($id_xml == 2 && $product->id_presta > 9000){
throw new \pricewars2\pricewarsSkipException('Produkt z nowej oferty');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment