Skip to content

Latest commit

 

History

History

Store Product Detail Add to Cart Button Url Redirect

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Store Product Detail Add to Cart Button Url Redirect

Synopsis

Redirect store product detail Add to Cart buttons to URLs of your choice.

Version

  • 0.7.0

SS Versions

v7.1 Fluid Engine Compatibility

  • Not Applicable

Dependencies


Install

  • Install twcsl. After you install twcsl be sure to continue on with the rest of the steps.

  • Add code from file store product detail add to cart button url redirect.html to Store Settings > Advanced > Page Header Code Injection for the store page. Read the code for any instructions within.

  • Options

    • Some Add to Cart buttons redirect to any URL(s).

      • Edit a product.

      • Add the following to a code block in Additional Info.

        <script>
        
          twc.spdatcbur.idUrlMap = {
          
            /*
            
              the format of each line is a product id or sku and a URL
              
              copy and repeat the line below for each product id or sku, remove the
              "// " at the beginning of the line and enter the appropriate data. this
              has been done once initially
              
              */
              
            // '[enter product id or sku here between single quotes replacing square brackets]' : '[enter url here between single quotes replacing square brackets]',
            
            '[enter product id or sku here between single quotes replacing square brackets]' : '[enter url here between single quotes replacing square brackets]',
            
            };
            
          </script>
    • All Add to Cart buttons redirect to a single URL.

      • Set bailIfNoSkusInMap to false.

      • Set url to a URL.

Make a Donation

Please consider making a donation.

Changes

  • 2024-03-26

    • checked for v7.0 Avenue template compatibility
    • bumped version to 0.7.0
  • 2023-09-07

    • fix for Bedford template family both adding to cart and redirecting
    • bumped version to 0.6.1
  • 2023-02-01

    • support v7.0 Bedford template family
    • bumped version to 0.6.0
  • 2022-11-02

    • add class to atc button
    • bumped version to 0.5.0
  • 2022-10-19

    • fix sku not working for products with no variants
    • bumped version to 0.4.2
  • 2022-08-21

    • fix for atc button adding product to the cart
    • bumped version to 0.4.1
  • 2022-07-24

    • add support for using products ids
    • bumped version to 0.4.0
  • 2022-07-11

    • add v7.0 Ajax support
    • bumped version to 0.3.0
  • 2022-03-10

    • fix for $this undefined
    • bumped version to 0.2d1
  • 2022-02-28

    • checked for v7.0 Brine template family compatibility
    • updated to work with v7.1 product detail layouts
    • bumped version to 0.2d0
  • 2021-12-17

    • added bailIfNoSkusInMap flag to control if that check is done or not
    • restrict button selector to product detail area
    • bumped version to 0.1d6
  • 2021-12-10

    • freshen read me and other minor tweaks, no functional changes
    • tested v7.0 Pacific template family compatibility
    • bumped version to 0.1d5
  • 2021-06-04

    • initial version