WordPress.org

Ready to get started?Download WordPress

Forums

WP eCommerce
[resolved] [Plugin: WP e-Commerce] Disable ajax on add to cart (3 posts)

  1. alesub
    Member
    Posted 2 years ago #

    Is there a way of disabling ajax on add to cart button so it goes to the cart/checkout page when clicked? This is very useful for stores where people buy just one product at a time.

    http://wordpress.org/extend/plugins/wp-e-commerce/

  2. Vincent Robic
    Member
    Posted 1 year ago #

    A quick workaround, without hacking WP E-Commerce core :

    Open these files (located in your current theme) :

    • wpsc-grid_view
    • wpsc-list_view
    • wpsc-products_page
    • wpsc-single_product

    And find the product form in each of them :

    <form class="product_form" ... >

    All you need to do is to add within this form is :

    <input type="file" name="fake_file_to_disable_ajax" style="display: none;" />

    Why this workaround ? The Javascript function in wp-content/plugins/wp-e-commerce/wpsc-core/js/wp-e-commerce.js verifies that there is not file field before starting the ajax request.

  3. alesub
    Member
    Posted 1 year ago #

    Nice! what a cool way to avoid messing with core files!

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic