solidus

https://github.com/solidusio/solidus

Ruby

🛒 Solidus, the open-source eCommerce framework for industry trailblazers.

Spree::Promotion::Actions::CreateItemAdjustments#promotion_credit_exists?

Tells us if there if the specified promotion is already associated with the line item
regardless of whether or not its currently eligible. Useful because generally
you would only want a promotion action to apply to line item no more than once.

Receives an adjustment +source+ (here a PromotionAction object) and tells
if the order has adjustments from that already

Source | Google | Stack overflow

Edit

git clone [email protected]:solidusio/solidus.git

cd solidus

open legacy_promotions/app/models/spree/promotion/actions/create_item_adjustments.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Spree--Promotion--Actions--CreateItemAdjustments-promotion_credit_exists--for-pr


# Commit to git

git add legacy_promotions/app/models/spree/promotion/actions/create_item_adjustments.rbgit commit -m "better docs for Spree::Promotion::Actions::CreateItemAdjustments#promotion_credit_exists?"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Spree--Promotion--Actions--CreateItemAdjustments-promotion_credit_exists--for-pr

hub pull-request


# Celebrate!