Skip to content

Instantly share code, notes, and snippets.

@mbessolov
Created January 29, 2016 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbessolov/330b076b6ada6b0d1d20 to your computer and use it in GitHub Desktop.
Save mbessolov/330b076b6ada6b0d1d20 to your computer and use it in GitHub Desktop.
<?php
$this->createPriceListSubset(
100, // percentage of product catalog, e.g. 100 = all products, 5 = 5% of the entire catalog
['USD', 'EUR'], // currencies
[
1 => 1, // price tier "1 or more"
10 => 0.9, // price tier "10 or more", price value should be 90% of the previous tier
100 => 0.85, // price tier "100 or more", price value should be 85% of the previous tier
],
function($priceListId){
// List of various entities, that a price list should be assigned to
return [
$this->findEntityByClassAndId('AccountGroup', $priceListId);
$this->findEntityByClassAndId('Account', $priceListId);
$this->findEntityByClassAndId('Account', $priceListId + 1);
$this->findEntityByClassAndId('Account', $priceListId + 2);
];
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment