Giter Club home page Giter Club logo

dancer-plugin-interchange6's Introduction

Interchange

Interchange is a web application server, electronic catalog and database display system.

Features include:

  • online ordering
  • real-time payment processing integration
  • high-level database access and retrieval with SQL support
  • product categorizing, merchandising, and discounting
  • basic customer relationship management
  • dynamic content presentation
  • content management
  • internationalization and localization support
  • real-time tax and shipping hooks
  • reporting
  • web-based administration

License

Licensed under GPLv2. This program is offered without warranty of any kind. See file LICENSE for redistribution terms.

Copyright © 2002-2021 Interchange Development Group
Copyright © 1996-2002 Red Hat, Inc.
Originally based on Vend 0.2 and 0.3, copyright 1995-96 by Andrew M. Wilcox.

Documentation

More information is in the following files:

README.rpm-dist

Notes on using Interchange when installed from RPM packages.

README.debian

Notes on using Interchange when installed from Debian packages.

README-DEVELOPMENT.md

How to track ongoing development of Interchange.

doc/WHATSNEW-*

Changes per specified version family.

UPGRADE

Instructions on how to upgrade from an earlier Interchange version.

A documentation package is available, with documentation in many different formats. This and other information is available at the Interchange home on the web:

https://www.interchangecommerce.org/

Repository layout

Major files and directories in the distribution:

Makefile.PL

Script to create a Makefile, used for installation. Run ./configure for usage instructions.

dist/

The distribution files, exclusive of executable files and modules. Includes:

  • code/ - Usertags and other customizable code
  • interchange.cfg.dist - Distribution-default interchange.cfg
  • lib/ - Back-end administrative interface
  • src/ - C and Perl code for CGI link programs
  • strap/ - Demo catalog skeleton, used by makecat

eg/

Various helper scripts and addons.

hints.pl

OS-specific configuration settings.

lib/

The library modules needed to run Interchange.

relocate.pl

Script that adjusts paths in scripts/ for installation into bin/.

scripts/

The executable files, relocated to bin/ in the install directory.

test.pl

The installation test script.

Prerequisites

Interchange requires Perl 5.16.3 or later, on a Unix-like operating system. It is primarily used on various Linux distributions, and has also been used on FreeBSD, OpenBSD, macOS, and other Unix variants.

Interchange requires some extra Perl modules to be installed on your system. Unless you are installing from distribution-specific packages (Red Hat, Debian, etc.) the quick way to install the necessary support is to run from the untarred Interchange directory:

cpanm --installdeps .

Alternatively, you can run:

perl -MCPAN -e 'install Bundle::Interchange'

If you would like to use a specific installation of Perl, invoke Perl with an absolute path to the perl binary, such as

/usr/local/bin/perl -MCPAN -e 'install Bundle::Interchange'

Installation

You can install Interchange as root for a multi-user system-wide setup, or as an unprivileged user who will be the only one modifying Interchange files.

Here is the quick installation summary:

tar xvzf interchange-5.12.0.tar.gz
cd interchange-5.12.0
perl Makefile.PL
make
make test
make install

If you would like to use a specific version of Perl, simply invoke with an absolute path to the perl binary, such as:

/usr/local/bin/perl Makefile.PL

The build procedure asks where you’d like to install Interchange and the name of the user account that will own the installation.

The Interchange server doesn’t do much if it isn’t servicing one or more actual catalogs, so you next need to make your first Interchange catalog, as described in the next section.

Demo catalog

There is a demo catalog skeleton called strap included.

To build your own catalog from the demo, go to the directory where you installed Interchange (default is "interchange" in your home directory, /usr/local/interchange for root installations, or /usr/lib/interchange for RPM installations) and run:

bin/makecat

Follow the prompts and after restarting the Interchange server you should be able to access the new instance of the demo catalog.

Please note that some functionality (notably the reporting features) may not be available if you are not using an SQL database such as MySQL, PostgreSQL, or SQLite.

Try a live demo at: https://www.interchangecommerce.org/i/dev/demo

dancer-plugin-interchange6's People

Contributors

hexfusion avatar racke avatar syspete avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

melmothx

dancer-plugin-interchange6's Issues

Prevent soft 404 for categories

Add configuration entry/setting for navigation trees to determine whether to lookup navigation products. If a navigation tree is enabled for lookup, issue 404 if no products are found.

hook before_navigation_404

The new schema result class UriRedirect needs some code in DPIC6. My idea is to add a new hook before_navigation_404. This will allow us to release the hook/schema class and play with different ideas for the redirect code via the dancer app until we get exactly what we want for the plugin.

https://github.com/interchange/Dancer-Plugin-Interchange6/blob/people/hexfusion/404/lib/Dancer/Plugin/Interchange6/Routes.pm#L376

possible app use case.

hook 'before_navigation_404' => sub {
    my $tokens = shift;
    my $path = $tokens->{path};
    $path =~ s|^/||;

    debug "path ", $path;

    # check for uri redirect record
    my $redirect = shop_schema->resultset('UriRedirect')->find($path);

    if ($redirect) {
        # permanent redirect to specific URL
        debug "UriRedirect record found redirecting uri ", $redirect->uri_target,
            " for $path, with status code ", $redirect->status_code;

        Dancer::Continuation::Route::Forwarded->new(
            return_value => redirect(uri_for($redirect->uri_target), $redirect->status_code) )->throw;
    }
};

Cart item price assignment goes away

This seems to be a bug:

In Dancer::Plugin::Interchange6::Cart::BUILD, when a cart-product is retrieved from the database, the "price" field is ignored:

price            => $record->product->price,

Thus, if you have a custom price assigned (e.g., due to a discount), even though it gets stored in the table, the internal representation of the cart has the original products.price value.

In my case, I am repeating the custom calculation:

price            => $self->calculate_price($record->product, undef, $record->quantity),

as it seems safest not to rely on the stored price at all -- for instance, the quantity might have been changed elsewhere, or the user may have changed identities (logging in, or changing a coupon in force, etc.). Alternatively you could take the less paranoid approach and:

price            => $record->price,

bug using 'scalar' inappropriately in cart route

@murwiz added this to #25. New issue created to track this.

I think there's a bug in Interchange6::Routes::Cart:

    if (scalar($input)) {

I think you meant "ref($input)". I'm attempting to rewrite this code for my own purposes, then maybe you can look it over.

Route test fails

Failed test 'login successful and users_id set in debug logs'

at t/routes/routes.t line 280.

Using Regexp on $data->[2]{"message"}

got : 'Change users_id of 1 to: {'users_id' => 1}'

expect : (?^:Change users_id of Dancer.+to:.+> 1)

Perl 5.18.2.

Cannot reference cost('shipping') before it is assigned

I have a cart page which allows the customer to select the shipping mode (and thus determine shipping cost). The cart page also displays the current shipping cost, via $cart->cost('shipping') and assigning that to a context variable. However, if the "costs" structure is empty then a reference to cost('shipping') throws a fatal error (line 367).

The only way to know ahead of time if cost('shipping') is safe to call is to scan the costs array beforehand. I don't think cost('foo') should throw a fatal error, but should just return "undef".

Auto_page setting with fallback routes

Cross-reference with PerlDancer/Dancer#1081

The auto_page configuration option doesn't work with the fallback route as defined. I've found a fix:

    return if setting 'auto_page';
    # display not_found page
    status 'not_found';
    forward 404;

along with the small fix to Dancer::Renderer as indicated at the link above.

allow simple use of other auth mechanisms

Discussion on irc#interchange with @thunder- ...

<thunder_> what i am looking to create is an extension that can be used to login with oauth ... like 'login with google'  or 'login with facebook'  .. but then 'login with wyngle'  ... my own oauth server
<SysPete> ok
<thunder_> that extension will then pass some data so it can prefill the checkout page and such ... 
<SysPete> by default we use Dancer::Plugin::Auth::Extensible::DBIC in Dancer::Plugin
<SysPete> I'll raise an issue in the Dancer::Plugin::Interchange6 on github aout this
<SysPete> do you have a GH account so I can cc you on issue?
<thunder_> http://advent.perldancer.org/2010/17
<thunder_> Something like this .. Considering the use of Dancer it would probably make sense to extend this to Dancer::Plugin::Auth::Wyngle or something ... 

Missing "checkout" route

The documentation says a checkout form is supported as a standard route, but the code indicates this route is inactive and not recommended. We need a standard checkout route, even if it's very basic, just to provide an example of how to construct one.

Odd test failure in t/disabled_cart_and_checkout.t

http://www.cpantesters.org/cpan/report/2b62f04e-ebd8-11e5-8697-33abaef69d38

PERL_DL_NONLAZY=1 "/home/cpan/pit/bare/perl-5.20.1/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/00-load.t t/disabled_cart_and_checkout.t t/dpci6_bop.t t/manifest.t t/pod-coverage.t t/pod.t t/test_mysql.t t/test_postgresql.t t/test_sqlite.t
# Testing Dancer::Plugin::Interchange6 0.111, Perl 5.020001, /home/cpan/pit/bare/perl-5.20.1/bin/perl
t/00-load.t ..................... ok
t/disabled_cart_and_checkout.t .. 
All 4 subtests passed 
t/dpci6_bop.t ................... ok
t/manifest.t .................... skipped: Author tests not required for installation
t/pod-coverage.t ................ skipped: Author tests not required for installation
t/pod.t ......................... skipped: Author tests not required for installation
# with Test::Cart Test::DSL Test::Hooks Test::Routes Test::Shop
t/test_mysql.t .................. skipped: DBD::mysql required to run these tests
# with Test::Cart Test::DSL Test::Hooks Test::Routes Test::Shop
t/test_postgresql.t ............. skipped: DateTime::Format::Pg required to run these tests
# with Test::Cart Test::DSL Test::Hooks Test::Routes Test::Shop
    # using: DBD::SQLite 1.50
    # db: SQLite library version: 3.10.2
        # Role::Deploy
        # Test::DSL
        # Test::Hooks
        # Test::Routes
        # Test::Shop
t/test_sqlite.t ................. ok

Test Summary Report
-------------------
t/disabled_cart_and_checkout.t (Wstat: 139 Tests: 4 Failed: 0)
  Non-zero wait status: 139
Files=9, Tests=24, 33 wallclock secs ( 0.04 usr  0.16 sys + 24.12 cusr  7.88 csys = 32.20 CPU)
Result: FAIL
*** Error code 255

Removing limit from navigation search?

There doesn't seem to be a way to remove the limit from the navigation search, other than to set the configuration navigation.records to an absurdly large number.

Test segfault

Test Summary Report
-------------------
t/test_mysql.t     (Wstat: 11 Tests: 1 Failed: 0)
  Non-zero wait status: 11
t/test_postgresql.t (Wstat: 11 Tests: 1 Failed: 0)
  Non-zero wait status: 11
t/test_sqlite.t    (Wstat: 11 Tests: 1 Failed: 0)
  Non-zero wait status: 11

find_variant logic in cart_route

In Dancer::Plugin::Interchange6::Routes::Cart::cart_route, there is logic for determining a variant based on the submitted form input. In my case, where the variants are being presented as individual products for purchase (a sort of flattened presentation), this results in an odd situation: since I'm submitting nothing but (sku, quantity), there is no distinguishing feature in the variant search, and no variant is found.

for my $name (keys %$attr_ref) {
    $user_input{$name} = param($name);
}

The code above assembles a hash with all the attribute keys, but each of them is an undefined value.

unless ($cart_product = $product->find_variant(\%user_input, \%match_info)) { ... }

The code above ends up looking through all the attribute values for the product, but since none of them were specified in the input, no variant is found.

My workaround:

if (!grep { defined } values %user_input) {
    # No point looking for a variant; we'll just use the product we have.
    $cart_product = $product;
}
else { ... ->find_variant etc. }

Navigation template tokens

My plan is to use hashrefs as iterators for products again, objects can be requested on demand.

Also I would like to add a hook so you can mangle the search parameters.

Regards
Racke

Floating point problem in cart tests

http://www.cpantesters.org/cpan/report/b944f586-aa0f-11e3-82ba-e03e11bde73e

#   Failed test 'cart_subtotal is 5.34'
#   at t/routes/routes.t line 198.
#                   'cart_subtotal="5.33999999999999986"
# cart_total="5.33999999999999986"
# cart="BAN001:bananas:1:5.33999999999999986"
# '
#     doesn't match '(?^:cart_subtotal="5.34")'

#   Failed test 'cart_total is 5.34'
#   at t/routes/routes.t line 199.
#                   'cart_subtotal="5.33999999999999986"
# cart_total="5.33999999999999986"
# cart="BAN001:bananas:1:5.33999999999999986"
# '
#     doesn't match '(?^:cart_total="5.34")'

#   Failed test 'found qty 1 bananas in cart'
#   at t/routes/routes.t line 200.
#                   'cart_subtotal="5.33999999999999986"
# cart_total="5.33999999999999986"
# cart="BAN001:bananas:1:5.33999999999999986"
# '
#     doesn't match '(?^:cart="BAN001:bananas:1:5.34")'

Undefined subroutine &Dancer::Plugin::Interchange6::_shop_review

register shop_review => sub {
    _shop_review('Review', @_);
};

Seem like should be

register shop_review => sub {
  _shop_resultset('Review', @_);

error

Undefined subroutine &Dancer::Plugin::Interchange6::_shop_review called at /home/sam/camp59/local/lib/perl5/Dancer/Plugin/Interchange6.pm line 238.

Regression with new Test::Roo tests

t/test_mysql.t ....... # with Test::Cart Test::Routes Test::Shop
pop on reference is experimental at t/lib/Test/Cart.pm line 37.
Compilation failed in require at /home/racke/perl5/perlbrew/perls/perl-5.20.0/lib/site_perl/5.20.0/Module/Runtime.pm line 317.
t/test_mysql.t ....... Dubious, test returned 2 (wstat 512, 0x200)

Cart post with editable quantities fails when >1 qty is changed

@murwiz added this to issue #25:

Along the same lines: from a cart display page, where multiple items have an editable quantity field, there should be a way to update more than one of them. Right now you get something like:

isa check for "quantity" failed: ARRAY(0xaf1d1f8) is not a positive numeric. at (eval 1538) line 104.

Filter out obviously broken URLs from default route

265 Query SELECT COUNT( * ) FROM products me WHERE ( uri = 'img/.jpg' )
265 Query SELECT COUNT( * ) FROM products me WHERE ( uri = 'img/.jpg' )
265 Query SELECT me.sku, me.name, me.short_description, me.description, me.price, me.uri, me.weight, me.priority, me.gtin, me.canonical_sku, me.active, me.inventory_exempt FROM products me WHERE ( me.sku = 'img/.jpg' )

Odd test error with 0.060 release

E.g:: http://www.cpantesters.org/cpan/report/8b133baa-7651-11e4-b30e-757810862755

#   Failed test 'use Dancer::Plugin::Interchange6;'
#   at t/00-load.t line 7.
#     Tried to use 'Dancer::Plugin::Interchange6'.
#     Error:  The method 'rename' is not found in the inheritance hierarchy for class Dancer::Plugin::Interchange6::Cart at /home/sand/src/perl/repoperls/installed-perls/perl/v5.18.4/a2da/lib/site_perl/5.18.4/Class/Method/Modifiers.pm line 46.
#   Class::Method::Modifiers::install_modifier('Dancer::Plugin::Interchange6::Cart', 'around', 'rename') called at /home/sand/src/perl/repoperls/installed-perls/perl/v5.18.4/a2da/lib/site_perl/5.18.4/Moo/_Utils.pm line 36
#   Moo::_Utils::_install_modifier('Dancer::Plugin::Interchange6::Cart', 'around', 'rename', 'CODE(0x38927e0)') called at /home/sand/src/perl/repoperls/installed-perls/perl/v5.18.4/a2da/lib/site_perl/5.18.4/Moo.pm line 63
#   Moo::around('rename', 'CODE(0x38927e0)') called at /tmp/loop_over_bdir-4157-Q9PE24/Dancer-Plugin-Interchange6-0.060-pgR62j/blib/lib/Dancer/Plugin/Interchange6/Cart.pm line 427
#   require Dancer/Plugin/Interchange6/Cart.pm called at /tmp/loop_over_bdir-4157-Q9PE24/Dancer-Plugin-Interchange6-0.060-pgR62j/blib/lib/Dancer/Plugin/Interchange6.pm line 11
#   Dancer::Plugin::Interchange6::BEGIN() called at /tmp/loop_over_bdir-4157-Q9PE24/Dancer-Plugin-Interchange6-0.060-pgR62j/blib/lib/Dancer/Plugin/Interchange6/Cart.pm line 0
#   eval {...} called at /tmp/loop_over_bdir-4157-Q9PE24/Dancer-Plugin-Interchange6-0.060-pgR62j/blib/lib/Dancer/Plugin/Interchange6/Cart.pm line 0
#   require Dancer/Plugin/Interchange6.pm called at t/00-load.t line 7
#   main::BEGIN() called at /tmp/loop_over_bdir-4157-Q9PE24/Dancer-Plugin-Interchange6-0.060-pgR62j/blib/lib/Dancer/Plugin/Interchange6/Cart.pm line 0
#   eval {...} called at /tmp/loop_over_bdir-4157-Q9PE24/Dancer-Plugin-Interchange6-0.060-pgR62j/blib/lib/Dancer/Plugin/Interchange6/Cart.pm line 0
#   eval 'package main;
# #line 7 "t/00-load.t"
# use Dancer::Plugin::Interchange6 @args;
#1;
# ' called at /home/sand/src/perl/repoperls/installed-perls/perl/v5.18.4/a2da/lib/site_perl/5.18.4/Test/Stream/Util.pm line 60
#   Test::Stream::Util::spoof('ARRAY(0x28b3110)', 'use Dancer::Plugin::Interchange6 @args') called at /home/sand/src/perl/repoperls/installed-perls/perl/v5.18.4/a2da/lib/site_perl/5.18.4/Test/More.pm line 410
#   Test::More::use_ok('Dancer::Plugin::Interchange6') called at t/00-load.t line 7
#   main::BEGIN() called at /tmp/loop_over_bdir-4157-Q9PE24/Dancer-Plugin-Interchange6-0.060-pgR62j/blib/lib/Dancer/Plugin/Interchange6/Cart.pm line 0
#   eval {...} called at /tmp/loop_over_bdir-4157-Q9PE24/Dancer-Plugin-Interchange6-0.060-pgR62j/blib/lib/Dancer/Plugin/Interchange6/Cart.pm line 0
# Compilation failed in require at /tmp/loop_over_bdir-4157-Q9PE24/Dancer-Plugin-Interchange6-0.060-pgR62j/blib/lib/Dancer/Plugin/Interchange6.pm line 11.
# BEGIN failed--compilation aborted at /tmp/loop_over_bdir-4157-Q9PE24/Dancer-Plugin-Interchange6-0.060-pgR62j/blib/lib/Dancer/Plugin/Interchange6.pm line 11.
# Compilation failed in require at t/00-load.t line 7.
# BEGIN failed--compilation aborted at t/00-load.t line 7.
Bailout called.  Further testing stopped:  
# Testing Dancer::Plugin::Interchange6 , Perl 5.018004, /home/sand/src/perl/repoperls/installed-perls/perl/v5.18.4/a2da/bin/perl
# Looks like you failed 1 test of 1.
FAILED--Further testing stopped.
Makefile:939: recipe for target 'test_dynamic' failed
make: *** [test_dynamic] Error 1

------------------------------

"products" should be reset after hook

While exploring the "before_navigation_display" hook, I did this:

    debug('there are ' . $context->{count});
    my $p = $context->{products}->first;
    my @skus;
    while ($p) {
        push @skus, $p->sku;
        $p = $context->{products}->next;
    }
    debug('products list ' . join ',', @skus);

I.e., I "walked" the products iterator but did not reset it. As a result, the navigation page did not display any products.

define Interchange6::Routes layout in config

Currently we can define the IC6 route template in the config. I would like to be able to also define layout.

plugins:
  Interchange6::Routes
    cart:
      layout: no_sidebar
      template: cart_new
 template $routes_config->{cart}->{template}, \%values,
    { layout => $routes_config->{cart}->{layout} };

shop_cart->error fails in surprising fashion

My code fragment looks like this:

shop_cart->update(param('sku'), param('quantity'));
my $err = shop_cart->error;

I was figuring to get back the 'Product for 2001 not found in cart.' message and act on it. However, instead I got back nothing, and my debug log had a dump listing of the shop_cart object! I spent some time digging around in this, and I hit on this which saved me from insanity:

http://www.perlmonks.org/?node_id=413799

(That's some old, old wisdom there.)

So I added:

debug coderef2name(shop_cart->can('error'));

Much to my surprise this printed out "Dancer::error". So by some bizarre quirk of inheritance, the "error" method supplied by (I think) Interchange6::Role::Errors is being replaced by Dancer::error!

Remove template from Navigation?

We talked about moving template from navigation and having it be an Attribute which is part of my pull request. But we still have a call Dancer/Plugin/Interchange6/Routes.pm line 311

'return template $nav->template || $routes_config->{navigation}->{template}, $tokens;'

It would be nice to have access too something like find_attribute_value here so

return template $nav->find_attribute_value('template') || $routes_config->{navigation}->{template}, $tokens;

For now we could even just stick with the config.

$routes_config->{navigation}->{template}, $tokens;

$navigation->{count}, paging issues

The count iterator for the navigation route seems to be returning odd results. Right now it basically returns the same result of pager.last vs $products->pager->total_count. I believe this is causing issues with paging navigation menus. Can I get clarification on what this should return.

Runtime error on "limited_page" in test

http://www.cpantesters.org/cpan/report/5c12aec5-6c16-1014-9156-a8cb3ca9dc86

       # <h1>Runtime Error</h1>
        # <div id="content">
        # <h2>runtime error</h2><pre class="error">Can't locate object method "limited_page" via package "Interchange6::Schema::ResultSet::Product" at C:\strawberry182\cpan\build\Dancer-Plugin-Interchange6-0.071-cX0aX5\blib\lib/Dancer/Plugin/Interchange6/Routes.pm line 339.
        # </pre><div class="title">C:\strawberry182\cpan\build\Dancer-Plugin-Interchange6-0.071-cX0aX5\blib\lib/Dancer/Plugin/Interchange6/Routes.pm around line 339</div><pre class="content"><span class="nu">336</span>             # listing method on the resultset and we'll later need
        # <span class="nu">337</span>             # the pager for this resultset
        # <span class="nu">338</span> 
        # <span class="nu">339</span> <span style="color: red;">            my $products =</span>
        # <span class="nu">340</span>               $tokens->{navigation}
        # <span class="nu">341</span>               ->navigation_products->search_related('product')
        # <span class="nu">342</span>               ->active->limited_page( $tokens->{page},
        # </pre><div class="title">Stack</div><pre class="content">main in t/test_sqlite.t l. 27

"apply_cost" does not work correctly against shop_cart()

Note:
...
shop_cart()->apply_cost( name => 'shipping', amount => 1.23 );
debug(shop_cart()->cost('shipping'));
...
Bad argument to cost: shipping

If you dump out shop_cart()->costs, you see an empty array.

However, this works:

my $cart = shop_cart();
$cart->apply_cost( ... );

Sympa integration

Integration with Sympa or other mailing list manager might be neat.

adding variant to cart from product_list gives $product->uri

This seems like a bug.

$schema->resultset('Attribute')->create(
    {
        name             => 'rweight',
        title            => 'Choose Weight',
        type             => 'variant',
        priority         => 1,
        attribute_values => [
            { value => '2',  title => '2WT' },
        ]
    }
);

my $product = $schema->resultset('Product')->create(
    {
        sku => 'WBA0003',
        name => 'Orvis Helios 2 Fly Rod',
        short_description => 'Just cast  the rod and you will buy it',
        description => "Helios 2 fly rods are the best fly rods we have ever produced, period. ",
        price => '795',
        uri => 'orvis-helios-2-fly-rod',
        weight => '5',
        inventory_exempt => '1',
      });

$product->add_variants(
    {
        rweight => '2',
        sku    => 'WBA0001',
        name   => 'Orvis Helios 2 6ft 2wt 3pc Mid Flex',
        uri    => 'orvis-helios-2-620-3-mid-flex',
        price  => 795,
        weight => '5',
    },
);

$schema->resultset("Navigation")->create(
{ navigation_id => '1', uri => 'fly-fishing-gear', type => 'menu', description => 'Gear for fly fishing', name => 'Fly Fishing Gear' },
);


$schema->resultset('NavigationProduct')->create(
    { navigation_id => '1', sku => 'WBA0001' }
);

If I add the variant to /cart via form from a product_list.

<form action="/cart" method="POST" name="product">
<input type="hidden" name="sku" class="sku" value="WBA0001">
<button class="btn btn-success">Add to cart</button>
</form>

the code pushes me back to $product-uri but shouldn't I be able to add a variant to cart strait away?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.