Skip to content

Instantly share code, notes, and snippets.

@agoradesign
agoradesign / ProductCategoryApplicabilityChecker.php
Created September 10, 2019 07:52
commerce_discounted_product: example implementation for categories
<?php
namespace Drupal\fp_shop\Applicability;
use Drupal\commerce_discounted_product\Applicability\ApplicabilityCheckerInterface;
use Drupal\commerce_promotion\Entity\PromotionInterface;
use Drupal\commerce_promotion\Plugin\Commerce\PromotionOffer\OrderItemPromotionOfferInterface;
use Drupal\fp_shop\Commerce\CategoryRepositoryInterface;
use Drupal\fp_shop\Commerce\ProductRepositoryInterface;
@agoradesign
agoradesign / MYTHEME.libraries.yml
Last active April 12, 2022 15:54
Drupal Commerce 2.x ajaxified add to cart and wishlist snippets
ajax_add_to_cart:
js:
js/ajax_add_to_cart.js: {}
dependencies:
- core/jquery
- core/jquery.once
- core/drupal
- core/drupalSettings