WordPress.org

Support

Support » Plugins and Hacks » Hacks » Add to cart button WP E-commerce

Add to cart button WP E-commerce

  • Pleeeease help me out …
    I want to modify the “Out of stock” product functionality so that it could be added into cart. I want to change it into “Available to order” which means that the products can be added to chart like “In stock” possibility.
    Even though my product is out_of_stock() it could be added into chart..
    Taking sigle_product.php file I’ve modified so that “Add to chart button ” to appear for products that are not in stock..but it does’t work .It does not add the product in cart..
    I was thinking that I need to change the cart option from this page , or somthig else (i don;t have any clue ) but i really don’t know how..Help me,please!!

    <?php
    /**
    * Cart Options
    */
    ?>

    <?php if((get_option(‘hide_addtocart_button’) == 0) && (get_option(‘addtocart_or_buynow’) !=’1′)) : ?>
    <?php if(wpsc_product_has_stock()) : ?>
    <div class=”wpsc_buy_button_container”>
    <?php if(wpsc_product_external_link(wpsc_the_product_id()) != ”) : ?>
    <?php $action = wpsc_product_external_link( wpsc_the_product_id() ); ?>
    <input class=”wpsc_buy_button” type=”submit” value=”<?php echo wpsc_product_external_link_text( wpsc_the_product_id(), __( ‘Buy Now’, ‘wpsc’ ) ); ?>” onclick=”return gotoexternallink(‘<?php echo esc_url( $action ); ?>’, ‘<?php echo wpsc_product_external_link_target( wpsc_the_product_id() ); ?>’)”>
    <?php else: ?>
    <input type=”submit” value=”<?php _e(‘Add To Cart’, ‘wpsc’); ?>” name=”Buy” class=”wpsc_buy_button” id=”product_<?php echo wpsc_the_product_id(); ?>_submit_button”/>
    <?php endif; ?>
    <div class=”wpsc_loading_animation”>
    <img title=”Loading” alt=”Loading” src=”<?php echo wpsc_loading_animation_url(); ?>” />
    <?php _e(‘Updating cart…’, ‘wpsc’); ?>
    </div><!–close wpsc_loading_animation–>
    </div><!–close wpsc_buy_button_container–>
    <?php else : ?>
    <p class=”soldout”><?php _e(‘This product has sold out.’, ‘wpsc’); ?></p>
    <?php endif ; ?>
    <?php endif ; ?>

  • The topic ‘Add to cart button WP E-commerce’ is closed to new replies.