setono / syliusgiftcardplugin Goto Github PK
View Code? Open in Web Editor NEWSell gift cards on your Sylius store and let users use them in the checkout process
License: MIT License
Sell gift cards on your Sylius store and let users use them in the checkout process
License: MIT License
We have instruction to copy templates at installation steps.
Suggest copying/creating one-line-templates which just include desired ones.
Like this:
# app/Resources/SomeBundle/views/someView.html.twig
{% extends '@SyliusGiftCard/someView.html.twig' %}
Hello,
When trying to install (composer require setono/sylius-gift-card-plugin), I have the following issue:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for setono/sylius-gift-card-plugin ^0.7.0 -> satisfiable by setono/sylius-gift-card-plugin[v0.7.0].
- Conclusion: remove thecodingmachine/safe v0.1.16
- Conclusion: don't install thecodingmachine/safe v0.1.16
- setono/sylius-gift-card-plugin v0.7.0 requires thecodingmachine/safe ^1.0 -> satisfiable by thecodingmachine/safe[v1.0.0, v1.0.1, v1.0.2, v1.0.3, v1.1, v1.1.1, v1.1.2, v1.1.3].
- Can only install one of: thecodingmachine/safe[v1.0.0, v0.1.16].
- Can only install one of: thecodingmachine/safe[v1.0.1, v0.1.16].
- Can only install one of: thecodingmachine/safe[v1.0.2, v0.1.16].
- Can only install one of: thecodingmachine/safe[v1.0.3, v0.1.16].
- Can only install one of: thecodingmachine/safe[v1.1, v0.1.16].
- Can only install one of: thecodingmachine/safe[v1.1.1, v0.1.16].
- Can only install one of: thecodingmachine/safe[v1.1.2, v0.1.16].
- Can only install one of: thecodingmachine/safe[v1.1.3, v0.1.16].
- Installation request for thecodingmachine/safe (locked at v0.1.16) -> satisfiable by thecodingmachine/safe[v0.1.16].
Installation failed, reverting ./composer.json to its original content.
Could you please help me? I'd love to try this extension but I am stuck at installation stage for now.
Thanks,
Jon
I can't install plugin from readme file because:
cp -r vendor/setono/sylius-gift-card-plugin/tests/Application/templates/bundles/SyliusShopBundle/ templates/bundles/SyliusShopBundle/ cp: can't stat 'vendor/setono/sylius-gift-card-plugin/tests/Application/templates/bundles/SyliusShopBundle': No such file or directory
Some folders are excluded in .gitattributes
Please fix this
Hello,
Thank you for this plug-in!
I have a question about how it works.
I created a product and turned it into a gift card.
It works for the purchase and I find my new coupon.
But I don't understand why sometimes he's Enabled other times Disabled.
Can you tell me the logic behind this process please?
Thank you very much for your help!
Hello! :)
I'm using your plugin (0.8.1) on Sylius 1.6.
As you recommend, I'm using your order trait:
class Order extends BaseOrder implements SetonoSyliusGiftCardPluginOrderInterface
{
use SetonoSyliusGiftCardPluginOrderTrait {
SetonoSyliusGiftCardPluginOrderTrait::__construct as private __giftCardTraitConstruct;
}
}
When I do this, my fixtures installation command tells me:
But when I do it this way:
class Order extends BaseOrder implements SetonoSyliusGiftCardPluginOrderInterface
{
use SetonoSyliusGiftCardPluginOrderTrait;
public function __construct()
{
parent::__construct();
$this->giftCards = new ArrayCollection();
}
}
It works correctly.
If an admin creates a gift card manually and associates a customer with it, then the customer should receive an email with a notice
If balances not equal (so gift card used) - ability to click on Used at orders
link/button and see page with Orders list
where this GiftCard
was used.
In the /admin
area list the orders where a given gift card was used
I wasn't right at #25 that csrf protects from brute force attack, so to protect from it, we probably should add some actual protection. Like https://www.google.com/recaptcha/intro/v3.html
From other side, even with captcha protection here, attacker can brute force cart (by checking response for terms that means gift card applied) and we can't add something like captcha to cart.
So, I guess, the only way is:
When this fixture is made, add it to the test application
Suggest:
config/app/config.yaml
to just include it$container->prependExtensionConfig
rather than copy-paste.
Add a grid action that allows the resending of a gift card to the customer
As AdminOrderCreation
plugin have the same name at its CustomerRepositoryTrait
.
Something like findByEmailPartForGiftCard
(append context) or setonoFindByEmailPart
(prepend vendor name).
Reasons:
Related:
... as it required at another plugins (and we usually have prefer-stable
flag).
Or at least release, say, version 'v0.1.0' until it become stable.
I had to allow the customer to add and remove gift card on the payment step of the checkout process. I needed the customer to be redirected to the payment step and not to the cart summary page.
I had to override AddGiftCardToOrderAction
, RemoveGiftCardFromOrderAction
and addGiftCardToOrder.html.twig
to achieve that (replacing sylius_shop_cart_summary
by the route I wanted to redirect to)
May be it could be done with the referrer from the request, this way no matter where your user decides to implement the plugin, the customer will be redirected to the page the request came from ?
When I search for a gift card on this page: http://127.0.0.1:8000/app_dev.php/en_US/gift-card/search
for a gift card that doesn't exist I get this message: Your gift card will only be charged if you complete your order
. The message should probably be The gift card does not exist
.
If I search for a gift card with balance $0 I get the same message. I should instead see a balance of $0.
It would be useful to allow users to enter the Gift card code in the same input as regular coupon. It should also be a possibility, not the unique behavior. So we could add in admin panel a new configuration for GiftCard that would be like "Have 2 separate inputs in cart ?"
If yes : keep behavior like now
If no : Hook on "coupon application" and check whether it's a coupon (default behavior) or a Gift Card code.
We would also need to add a validator to GiftCardCode so they are never the same as coupon
I am using the default JS which uses the api()
method of the Semantic JS. It shouldn't use this. Instead just use the normal jQuery.ajax
If we put invalid or empty card number at /cart/
- something like json representation of form will be returned rather than just error message at cart
Obviously a JS problem, same as #44, so I checked which JS files are loaded... And the only one, setono-sylius-gift-card-add-gift-card-to-order.js
, isn't.
I checked in the vendor files, and apparently it's never included anywhere ! And surprisingly I didn't find any issue here about this.
I also tried to manually include it, but that doesn't seem to fix the problem.
I even tried to copy this block from test cart summary file (only file I found using this js here) :
<script src="{{ asset('bundles/setonosyliusgiftcardplugin/setono-sylius-gift-card-add-gift-card-to-order.js') }}"></script>
<script>
$('#setono-sylius-gift-card-add-gift-card-to-order').addGiftCardToOrder();
</script>
But again, that didn't fix the problem.
Currently, if you go to http://localhost:8000/en_US/gift-card/search?code=SOME_VALID_CODE, you will see it, but shouldn't.
_csrf_token
should be checked to prevent brute-force.
Following the default installation instructions on a clear Sylius 1.7 installation leads to a 'Uncaught Exception: Unable to find template ""' error.
So small updates at gift card plugin templates can be automatically updated in apps
Suggest load config via extension (DependencyInjection/SetonoSyliusGiftCardExtension) rather than doing this at installation step:
imports:
- { resource: "@SetonoSyliusGiftCardPlugin/Resources/config/config.yml" }
Hello,
On AJAX call to select customer associated to gift card with lots of users, their is a timeout or it's loaded when we are lucky after 15 seconds. So I add a limit to the repository method on this call.
This is the pull request: #72
In the /admin
are create a link to the order where the gift card was purchased (if it was purchased on an order)
When I create a gift card in the backend the option Is shipping required
should be set to false by default (since a gift card will be delivered by email).
We need fixtures
PS: README.md
have instruction to include fixtures.
User should have ability to remove gift card from cart after it have been added
Which amount was there before some part was spent
So admin can see on which order what amount of gift card was spent
Somethiing like this:
final class AddAdjustmentsToOrderAdjustmentClearerPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container): void
{
if (!$container->has('sylius.order_processing.order_adjustments_clearer')) {
return;
}
$clearerDefinition = $container->getDefinition('sylius.order_processing.order_adjustments_clearer');
/** @var array $adjustmentsToRemove */
$adjustmentsToRemove = $clearerDefinition->getArgument(0);
$adjustmentsToRemove[] = AdjustmentInterface::ORDER_GIFT_CARD;
$clearerDefinition->setArgument(0, $adjustmentsToRemove);
}
}
AdjustmentsByLabelAggregator
Code still can be retrieved at $adjustment->getOriginCode()
For Customer, at account area, some page with list of all gift cards (balances and links to view it) will be great I guess
As security option, probably Customer shouldn't see full codes, just have a buttons to send code to own email.
List orders
page should show only completed orders (as we have Impossible to access an attribute ("firstName") on a null variable.
exception if gift card attached to cart and order not completed yet)List orders
button should not be shown only if gift card used on completed orderFile like tests/Application/templates/bundles/SyliusShopBundle/Checkout/_summary.html.twig
missing at https://github.com/Setono/SyliusGiftCardPlugin/tree/master/tests/Application/templates/bundles/SyliusShopBundle
(Its about /checkout/address
, /checkout/select-*
pages)
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.