leotiger / grav-plugin-shoppingcart-personalizer Goto Github PK
View Code? Open in Web Editor NEWA personalization add-on for the GRAV Shoppingcart
License: MIT License
A personalization add-on for the GRAV Shoppingcart
License: MIT License
Very excited about this project! Grav could really use a native shopping cart and you've gone a long way to making it happen.
I'm building a store to sell online and in-person courses. I noticed that when the Personalizer plugin is enabled, the Admin plugin shows a second set of Yes|No toggles for the Published status on the Options tab for the shoppingcart_products and shoppingcart_product pages.
The HTML looks like this:
<div class="form-field grid form-field-toggleable ">
<div class="form-label block size-1-3">
<span class="checkboxes toggleable" data-grav-field="toggleable" data-grav-field-name="data[header][published]">
<input id="toggleable_header.published" value="1" name="toggleable_data[header][published]" checked="checked" type="checkbox">
<label for="toggleable_header.published">
</label>
</span>
<label class="toggleable" for="toggleable_header.published">
<span class="hint--bottom" data-hint="By default, a page is published unless you explicitly set published: false or via a publish_date being in the future, or unpublish_date in the past">
</span>
</label>
</div>
<div class="form-data block size-2-3" data-grav-field="toggle" data-grav-disabled="1" data-grav-default="null" data-grav-field-name="data[header][published]">
<div class="switch-toggle switch-grav medium switch-4 ">
<input value="0" id="toggle_header.published0" name="data[header][published]" class="" type="radio">
<label for="toggle_header.published0">
</label>
<input value="1" id="toggle_header.published1" name="data[header][published]" class="highlight" checked="checked" type="radio">
<label for="toggle_header.published1">
</label>
<input value="2" id="toggle_header.published2" name="data[header][published]" class="" type="radio">
<label for="toggle_header.published2">
</label>
<input value="3" id="toggle_header.published3" name="data[header][published]" class="" type="radio">
<label for="toggle_header.published3">
</label>
</div>
</div>
</div>
If I select either of the second set, the page fails to save with a validation error. The first set works as expected.
The shoppingcart_categories page toggles are normal.
Using Admin Panel to install, I am blocked by the following error:
Dependency form is required in an older version than the one installed. This package must be updated. Please get in touch with its developer.
I will have a try with manual installation options as well โ just raising an issue here as well, since it seems a fix is needed to maintain compatibility.
Update: manual installation causes site to crash. Seems this plugin is no longer usable with latest version of Grav/Forms
If I enable the Variation Required option, the Products item in a Products page shows "From NNN" where NNN is the price before variation amounts are added. So the user sees a price that is not available to them. For example, with
The user sees From $10, but only $10+$80 or $10+25% prices are available.
This appears to be implemented with the following lines in shoppingcart_core_pricelowest.html.twig:
{% for group in variationgroups if group.variations|length > 0 and group.grouprequired %}
{% set groupindex = 'g_' ~ (loop.index * 1000) ~ '_' %}
{% set prices = { 0: 100000000 } %}
{% for variation in group.variations %}
{% if variation.price matches '/^[0-9]*\\.?[0-9]+$/' %}
{% set prices = prices|merge({(loop.index) : (group.groupasinput ? variation.price * (variation.varmin ? variation.varmin : group.groupmin) : variation.price) }) %}
{% elseif group.groupprice matches '/^[0-9]*\\.?[0-9]+$/' and group.groupprice > 0 %}
{% set prices = prices|merge({(loop.index) : (group.groupasinput ? groupprice * (variation.varmin ? variation.varmin : group.groupmin) : group.groupprice)}) %}
{% endif %}
{% endfor %}
{% set initialPrice = (initialPrice + min(prices)) %}
{% endfor %}
Although I can't figure out where the word "From" is being added to this.
Hello,
Thanks for your great work.
Will you merge your shoppingcart-personalizer module and original shoppingcart into one new-shoppingcart?
Or do we need to use shoppingcart-personalizer as addon and also shoppingcart module?
When the Variation Required value is set to No, the variation list appears with "PLUGIN_SHOPPINGCART.PERSONALIZE_SELECT_VARIATION" because that constant is not defined anywhere.
Does this addon support variable products ?
Like products with different color or size? Or we will need to create separate products for each variation?
If yes, where i can find documentation to create variable products?
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.