Skip to content

Instantly share code, notes, and snippets.

View btekbtek's full-sized avatar
💭
Freelancer

BartZ btekbtek

💭
Freelancer
View GitHub Profile
@Hailong
Hailong / Index.php
Last active November 25, 2020 01:23
Fix ShipStation plugin for Magento 2.3
<?php
namespace Auctane\Api\Controller\Auctane;
use Exception;
use Magento\Framework\App\CsrfAwareActionInterface;
use Magento\Framework\App\Request\InvalidRequestException;
use Magento\Framework\App\RequestInterface;
class Index extends \Magento\Framework\App\Action\Action implements CsrfAwareActionInterface
{
@CarsonBain
CarsonBain / shopify-order-form.md
Last active July 19, 2023 10:16
Building a Quick Order Form with the Shopify AJAX API

Building a Quick Order Form with the Shopify AJAX API

This post will take you through the steps to add a quick order form page on your Shopify store. The form we will be adding allows users to quickly select quantities of items they would like to purchase, and then add all selected items to cart with one click.

Using the AJAX API for this type of task will give us a large amount of flexibility in how we can add items to the cart.


Creating a new page template

# Use an array to keep track of the discount campaigns desired.
CAMPAIGNS = [
# $5 off all items with the "sale" tag
ItemCampaign.new(
AndSelector.new(
TagSelector.new("sale"),
ExcludeGiftCardSelector.new,
),
MoneyDiscount.new(5_00, "5$ off all items on sale",),
),
@lushc
lushc / gist:8181837
Last active June 20, 2019 11:12
How to fix ffi gem conflict when installing vagrant-librarian-chef
  1. Navigate to C:\HashiCorp\Vagrant\embedded and run msys.bat. This will open a MINGW32 console.
  2. From the MINGW32 consloe run export GEM_HOME=/c:/HashiCorp/Vagrant/embedded/gems; gem list. You should see the ffi gem listed with a version number greater than 1.3.1.
  3. Run gem uninstall ffi
  4. Run gem install ffi -v 1.3.1

This should resolve the "Failed to load the 'vagrant-librarian-chef' plugin" issue, at least for Vagrant 1.3.5 and Chef 11.8.0.