Need some help: Add to cart - by Self - on WordPress WooCommerce support

This topic has 5 replies, 2 voices, and was last updated 8 years, 11 months ago ago by Self

  • Avatar: SelfOutlet
    Self
    Participant
    March 24, 2015 at 01:23

    Hi,

    When changed our them to Royal, our sells are gone down seriously. So we was thinking about the cause of this efect and we think in two possibility:

    1 – In the old theme, we had the “Add to cart” button visible bellow every product (front page, store…) and was working fine with WooCommerce Advanced Product Quantities. As you see, we don’t sell 1 unit per product but it’s variable depend of the batch (min 25, 50, 100 …).

    With Royal was impossible and i’ve post the problem here more than month ago without solution. Well, was update, and update…. and more bugs, more edits..! > https://www.8theme.com/topic/a-new-royal-user-with-some-problems/ Without been resolved!

    So, without a Php good knowledges, i’ve got some GOOD results. Now i can display the Quantity near the Add to card button (see it here: http://www.ropaoutletbarcelona.es/en) and seems working. I’ve edited /themes/royal/woocommerce/loop/add-to-cart.php and i don’t remember, i’ve edited more than this to works. Because i’ve got it displayed but wasn’t adding to cart (top, or cart page).

    Why i’m here now?

    So, need some help to customize this better:

    – The hover of Add to cart isn’t correct.
    – The Js animation of the button when adding a product has changed, and don’t look good.
    – Before my modifications, i think that the page no uploaded when a product is added. Now it uploads, and there is a notification to go to cart. If possible add without upload page and keep out the notification.

    2 – I’m using qTranslate (i know, isn’t the better, but i’m a little tired for the moment, to change it. And when something works fine, a modification will be a 90% of bugs…).

    So, some costumers tolds me that when they click on the cart in the header they got “Page not found”. I’ve tried and for me it works. So i think that the translated link isn’t the correct.

    What i have: http://www.ropaoutletbarcelona.es/carro?lang=es
    And must be: http://www.ropaoutletbarcelona.es/es/carro

    I’ve looked for the file to modify… but nothing. So if you can help me to find it, and why not edit it. There is 2 ways to do it:

    <a href='/<?php echo qtrans_getLanguage(); ?>/carro/' class='button wc-forward'><?php _e( 'View Cart', 'woocommerce' ); ?></a>
        <a href="/<?php echo qtrans_getLanguage(); ?>/finalizar-comprar/" class="button checkout wc-forward"><?php _e( 'Checkout', 'woocommerce' ); ?></a>

    Or

    <?php if(qtrans_getLanguage() == "es") : ?>/carro/<?php endif ?> (the default language is Spanish)
    <?php if(qtrans_getLanguage() == "en") : ?>/en/carro/<?php endif ?>

    NB: No needs for updates (i’ve some plugins, the theme without updating), if this will do more troubles.

    There other think, but the priority is this for the moment.

    Thank you!

    Please, contact administrator
    for this information.
    4 Answers
    Avatar: Eva
    Eva Kemp
    Support staff
    March 24, 2015 at 11:22

    Hello,

    1. Please add this code for the button hover in custom.css file:

    button.btn.border-grey.progress-button:hover {
      color: black !important;
    }

    2. Could you please show a screenshot what the problem is with “Js animation” when adding a product to the cart? I’ve checked it and haven’t seen any problems.
    3. Sorry, but in this case you need check your modifications as we can’t know what you customized.
    4. This is the configuration of qTranslate plugin.
    You should contact their support concerning this issue.

    Please take our apologies.

    Regards,
    Eva Kemp.

    Avatar: SelfOutlet
    Self
    Participant
    March 24, 2015 at 16:02

    Hi Eva,

    1 – i’ve resolved it by Css. Look better now!
    – The problem was in .progress-button.state-success (style.css) .content::after, the background-image: url(images/check-new.png); appears after “load success”. Resolved!

    BUT just need now to change the Hight and Color from the Dark progress effect to anther color. Talking about the Progress Effect shown into the Add to cart btn. Each css class can i edit?
    – The page still reloading after Add to cart action. Maybe because the action is “/?add-to-cart=20694”. Well, if some solution ok, if not i’ll keep it like this for the moment.

    2 – The qtranslate is correctly configured to use /Language/Target and not /Target?lang=Language. I’ve resolved it in the Royal theme before update, but when updated i’ve lost it and i dont’t remember each file i’ve to edit now.

    Please just tell me each file en FTP can i edit to change the link target of the mini cart in the header. it’s a theme issue.

    ¿Some help?

    I’ve seen that u’ve changed the theme to default themes, i’ve lost some css that was in Appareance > Edit Css. But i had a backup, so i’ve put all in Costum.css! I’ts Ok 🙂

    TIP:

    .slide-item .progress-button must be Relative and not Static (style.css)! Coz the load bar show 100% height of .slide-item (Related products)! 😉

    Thank you!

    Avatar: Eva
    Eva Kemp
    Support staff
    March 26, 2015 at 11:10

    Hello,

    1. Please add this code in custom.css block to change height and color of progress button:

    .progress-button .progress, .progress-button .progress-inner {
    	background-color: blue !important;
    	height: 10px !important;
    	margin-top: 10px;
    }

    2. You need edit the file wp-content/themes/royal/framework/woo.php (section “! Top Cart Widget”, lines 1224 and 1327).

    Regards,
    Eva Kemp.

    Avatar: SelfOutlet
    Self
    Participant
    April 9, 2015 at 15:24

    Hi Eva,

    Thank you for your answer! I did more modification, and i think it’s ok for the moment.

    Next, i’ll be edit the Quick view to show the qty conform with the mix/max qty configured.

    But i have a small problem: the add to card i’ve modified seems incompatible with navegadors, works only with firefox. I mean, the product isn’t added to card with Safari, Chrome….

    I’m not talking about the button in single product, i’m talking about the button in index, store, featured, related…

    That’s why i deactivate the form editing the Header.php en admin, with conditions:

    <!-- for product-details -->
        <?php
        $msie = strpos($_SERVER["HTTP_USER_AGENT"], 'MSIE') ? true : false;
        $firefox = strpos($_SERVER["HTTP_USER_AGENT"], 'Firefox') ? true : false;
        $safari = strpos($_SERVER["HTTP_USER_AGENT"], 'Safari') ? true : false;
        $chrome = strpos($_SERVER["HTTP_USER_AGENT"], 'Chrome') ? true : false;
        ?>
    <?php 
    /* Our navigation menu.  If one isn't filled out, wp_nav_menu falls back to wp_page_menu.  
     * The menu assiged to the primary position is the one used.  If none is assigned, the menu with the lowest ID is used.*/ ?>
    <?php if( $firefox ): ?>
    <style type="text/css">
    .product-details form {
    visibility: visible;
    }
    </style>
    <?php else: ?>
    <style type="text/css">
    .product-details form {
    visibility: hidden;
    </style>
    <?php endif; ?>
    <!-- end navigation -->

    this is the Add to card i have now after modification if you can see and tell me what’s wrong with it, i mean why isn’t compatible:

    <?php
    /**
     * Loop Add to Cart
     *
     * @author 		WooThemes
     * @package 	WooCommerce/Templates
     * @version     2.1.0
     */
    
    if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
    
    global $product;
    
    switch ( $product->product_type ) {
    case "variable" :
    $link = get_permalink($product->id);
    $label = apply_filters('variable_add_to_cart_text', __('Select options', 'woocommerce'));
    break;
    case "grouped" :
    $link = get_permalink($product->id);
    $label = apply_filters('grouped_add_to_cart_text', __('View options', 'woocommerce'));
    break;
    case "external" :
    $link = get_permalink($product->id);
    $label = apply_filters('external_add_to_cart_text', __('Read More', 'woocommerce'));
    break;
    default :
    $link = esc_url( $product->add_to_cart_url() );
    $label = apply_filters('add_to_cart_text', __('[:es]Comprar[:en]Buy it', 'woocommerce'));
    break;
    }
    ?>
    <form action="<?php echo esc_url( $product->add_to_cart_url() ); ?>" class="cart" method="post" enctype='multipart/form-data'>
    <?php woocommerce_quantity_input(); ?>
    <button type="submit" class="btn border-grey progress-button" style="background-color: rgb(255, 255, 255); border: 1px solid rgb(204, 204, 204) ! important;"><?php echo $label; ?></button>
    </form>
    <?php
    
    $class = '';
    $html = '<a href="%s" rel="nofollow" data-product_id="%s" data-product_sku="%s" data-quantity="%s" class="btn border-grey %s product_type_%s"><i class="ico-smallpacket"></i> %s</a>';
    
    if(etheme_get_option('ajax_addtocart') && $product->is_purchasable() && $product->is_in_stock() > 0 && $product->product_type == 'simple') {
    	$class .= 'etheme_add_to_cart_button ';
    	$html = '<a href="%s" rel="nofollow" data-product_id="%s" data-product_sku="%s" data-quantity="%s" class="btn border-grey progress-button %s product_type_%s" data-style data-horizontal="shrink"><i class="ico-smallpacket"></i> %s</a>';
    }
    echo apply_filters( 'woocommerce_loop_add_to_cart_link',
    	sprintf( $html,
    		esc_url( $product->add_to_cart_url() ),
    		esc_attr( $product->id ),
    		esc_attr( $product->get_sku() ),
    		$class,
    		esc_attr( $product->product_type ),
    		esc_html( $product->add_to_cart_text() )
    	),
    $product );
  • Viewing 5 results - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.