brille24 / syliustierpriceplugin Goto Github PK
View Code? Open in Web Editor NEWA plugin for Sylius that implements tier pricing
License: MIT License
A plugin for Sylius that implements tier pricing
License: MIT License
Currently it just works for the current price. If you want to display an old price with a line through this will not work in the current version.
Tried to delete a price tier but not working
I have an instance of Sylius v1.11 standard edition runnning where I installed Tier Price plugin following instructions on the readme. However, I cannot see the menu entry For Tier prices as shown in the instructions screenshot.
The deviation I was forced to take from the instruction is that I manually merged the contents of Resources/config/config.yml inside of config/package/_sylius.yaml and also updated src/Entity/Product/ProductVartiant.php to extend from you plugin rather than from Sylius Core.
Please notice that the menu entry and form do show up for simple products. Yet I need configurable products.
Is Standard Edition simply not supported or am I missing something?
Thanks in advance.
Hi,
I try to install your plugin but when I update the database, the console show the exception
In SchemaException.php line 108:
The table with name 'sylius_dev.sylius_product_variant' already exists.
My sylius version is 1.7
The validation constraint for a TierPrice is defined in SyliusTierpricePlugin/src/Resources/config/validation/validation.xml
.
It defines a constraint LessThanOrEqual
with value 0 for the price.
Unless I missed something, it should be GreaterThanOrEqual
with value 0.
In order to reproduce (in Admin UI) the problem I'm facing, make sure you have an existing product with only one tier price for one customer group.
Delete the existing tier price (don't save yet) and then add new one using exactly the same values as the one deleted. Save the tier price and you will get an exception.
Trying the same scenario with no customer group selected isn't throwing the exception.
Sylius version : 1.9
Plugin version : v2.0.1
After installing the plugin, I noticed that all the migrations that we create using the doctrine:migrations:diff (or :generate) ends up in the plugins migration folder, instead of the project's directory.
Turns out the plugin's Brille24SyliusTierPriceExtension class prepend its migration_path, causing the following thing :
Migrations are correctly setup in our project (see our config/packages/doctrine_migrations.yaml file)
image
Maybe you can follow this patch from BitBagCommerce/SyliusWishlistPlugin
Thanks
Thanks for the work on this bundle, it's great.
This bundle is currently not allowing usage with Sylius 1.5. Do you see any specific reason why not to tag master, as it has a dependency on Sylius (^1.4
) that'd allow using v1.5?
Currently we can only use Sylius 1.4, as the latest tag (see https://github.com/Brille24/SyliusTierpricePlugin/blob/v1.4.5/composer.json#L9) does not allow using anything > 1.4.X.
It should be possible to create the tier prices with the Sylius Fixture mechanic.
Hi there,
thanks for this great addition to sylius.
Did anyone expierence already some issues with 100's of quantities?
We planned to use this plugin for like quantities of 250 - 1000 units.
The problem what i expierenced is that for all of those quantities it would run as many adjustments on the pricings and applieng coupons and stuff just makes it a huge mess and comes into database lock issues etc. For now i handled that with Memcache to not run in locking issues.
Did anybody solve that? Did you turn off automatic adjustments then? Or any suggestions how to handle 100's of quantities?
Currently the plugin only supports Sylius up to version 1.3. Because in 1.4 there is a backwards compatibility break in Behat. The plugin needs to be upgraded according to this guide:
https://github.com/Sylius/PluginSkeleton/blob/master/UPGRADE-1.4.md
Container fails to compile if I import resource '@Brille24SyliusTierPricePlugin/Resources/config/config.yml'
via config/config.yaml
(so: following Readme instructions).
The service "Brille24\SyliusTierPricePlugin\Factory\TierPriceFactoryInterface" has a dependency on a non-existent service "brille24.factory.tierprice".
But it will compile if I include / replace relevant lines in _sylius.yaml
config file.
Main packages are
"require": {
"php": "^8.2",
"ext-json": "*",
"brille24/sylius-tierprice-plugin": "2.3.2",
"sylius/invoicing-plugin": "^0.24.0",
"sylius/paypal-plugin": "^1.5.1",
"sylius/refund-plugin": "^1.4",
"sylius/sylius": "1.12.12",
"symfony/dotenv": "^6.3.7",
"symfony/flex": "^2.4.1",
"symfony/runtime": "^6.3.2"
},
Update: while container complies if I make changes / additions to sylius resources in _sylius.yaml
file, attempting to update doctrine schema ill fail with The table with name "alka_webshop.sylius_product_variant" already exists.
It will work if I update ProductVariant
definitions in App bundle with SyliusTierPrice bundle relevant changes.
To ensure code quality we should adapt the travis workflow that Sylius has to test the code.
It seems impossible to override plugin templates using the Symfony's override bundle resource functionality.
This applies to Sylius ThemeBundle as well; neither of structures below work, Symfony Profiler consistently lists rendered template (name & path) as @Brille24SyliusTierPricePlugin/Resources/views/Shop/Product/Show/_tier_price_promo.html.twig
/ vendor/brille24/sylius-tierprice-plugin/src/Resources/views/Shop/Product/Show/_tier_price_promo.html.twig
, also after clearing cache.
App:
- templates
- bundles
- Brille24SyliusTierPricePlugin
- Shop
- Product
- Show
- _tier_price_promo.html.twig
Theme:
- themes
- [theme]
- Brille24SyliusTierPricePlugin
- views
- Shop
- Product
- Show
- _tier_price_promo.html.twig
Where did it originate from
In the commit c3f21ee#diff-acdf3d30cb1e2b445a95f6b746645e0f a listener was added to inject the tier price menu item into the product menu in Sylius.
This works for simple product items in Sylius, but when you try to edit or create a product which has variants, it crashes on the form for it can't find the part form.varaint in the twig template of views/Admin/ProductVariant/Tab/_tierprice.html.twig (line 33).
How to reproduce
Temporary fix
The solution to fix it for now in a project was by removing the service brille24.listener.admin.product.form.menu_builder in a compiler pass.
After adding the bundle using composer, I added the following part to AppKernel following the README.
public function registerBundles()
{
return array_merge(parent::registerBundles(), [
...
new \Brille24\SyliusTierPricePlugin\Brille24SyliusTierPriceBundle(),
]);
}
This file is missing in the bundle. I would aspect it to be at vendors/brille24/sylius-tierprice-plugin/Brille24SyliusTierPriceBundle.php.
Does the part in the AppKernel need to point to another file, or is the file missing?
Hello everyone, I would like to congrats you for this awesome plugin, great job! It surly provides really useful functionality for Sylius :) I think we would be very proud to show your plugin on plugins list on our website, however we have some strict naming conventions defined, which not all of them are fulfilled by this project - take a look at http://docs.sylius.com/en/1.1/plugins/creating-plugin.html#naming-conventions. The most important thing is using SyliusPluginTrait
and proper extension naming.
Moreover, if you would need/want some code review regarding Sylius coding standards, I'm sure some of us would be pleased to do this :)
Nevertheless, great work, it's good to have such a plugin in Sylius ecosystem and such a team in Sylius community :)
Hi, everyone ! I have an error in the admin form.
This error seems to be related to form extension priority and I fixed it by adding a priority tag, see : https://docs.sylius.com/en/1.7/customization/form.html#need-more-information
Any chance for compatibility with Sylius 1.12?
Add a Symfony Validator to validate the ArrayCollection of Tierprices that there are not two entries with the same quantity but different prices.
Recieving
bin/console doctrine:schema:update --force
[OK] Nothing to update - your database is already in sync with the current entity metadata.
On base installation (all caches cleared). Tested on both Sylius 1.8 and 1.7.
Order price recalculator do not set original price on order item
After upgrading from 1.0 to 1.6, my existing fixtures failed to load.
It seems that the TierPriceExampleFactory is not properly configured to resolve the fixtures data, and turn the given strings (product_variant and channel) into the matching objects.
It would be nice if the tier price base on customer group.
Add the method calculateLowestPriceBeforeDiscount
in the price calculator.
I discovered an issue when i tried saving an empty row. I expected it to have the same behaviour as delete_empty
would have, but instead the plugin tried to save the empty row. Which throwed an exception because null
is not a NumberType
. I tried to add the delete_empty => true
to the collection type, but this did not have any effect. I added a suggestion to fix this, but of course any other fix is also very welcome. I am not able to provide a PR due to time constraints.
Expected argument of type "int", "null" given at property path "qty".
Add empty_data => 0
to both the qty
and price
types in the TierPriceType
I am on Sylius 1.3.5 and it won't allow me to install (tried also version 0.8).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.