Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #691039

    neckwear
    Participant

    Hi!

    We’re building a woocommerce site with X theme and want to make the size variable on the product page like label buttons. I’ve installed a plugin that turns them into radio buttons but and i’m not sure how to proceed. Basicly what we want is a button that says small and one that says large and you push the option you want and then add to cart.

    Also, we’d like to put our shipping and payment logos under the add to cart button, i’ve tried adding the image in the template for the variable product under the button but when I do my add to cart button goes missing on the product page.

    Thank you!

    #691042

    neckwear
    Participant
    This reply has been marked as private.
    #691491

    Rue Nel
    Moderator

    Hello There,

    Thanks for writing in!

    I recommend that you increase your memory allocated to PHP. You can check this warning in WooCommerce > System Status > WordPress Environment > WP Memory Limit. To increase it, please edit your wp-config.php file and insert these lines:

    define( 'WP_MEMORY_LIMIT', '256M' );
    define( 'WP_MAX_MEMORY_LIMIT', '512' );

    You can add it before the line
    /*That's all, stop editing! Happy Blogging. */

    I did some further investigation. I noticed that you are using PHP version 5.3.29 and WordPress 4.3 requires at least 5.4. This could possibly be the cause of the issue. In most cases you cannot update your PHP version yourself and need to contact your host about this. The upgrade process is an easy process and should be something your host can do for you without affecting your website or charging you for it. Here’s a letter you can send to your hosting company:
    `Dear host,

    I’m running a WooCommerce webshop on one of your server and WooCommerce has recommended PHP version of 5.4. WordPress, the CMS that WooCommerce uses, has also listed this version as the recommended PHP version on their requirements page: https://wordpress.org/about/requirements/
    Can you please let me know if my hosting supports PHP 5.4 or higher and how I can upgrade?
    Looking forward to your reply.`

    Hope this helps. Kindly let us know.

    Regarding the Woo Radio buttons, this is an issue with a third party plugin. Regretfully, we cannot provide support for third party plugins as our support policy in the sidebar states due to the fact that there is simply no way to account for all of the potential variables at play when using another developer’s plugin or script. Because of this, any questions you have regarding setup, integration, or troubleshooting any piece of functionality that is not native to X will need to be directed to the original developer. Thank you for your understanding.

    To put the shipping and payment logos under the add to cart button, we would like to suggest that you use a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

    Once you already have your child theme active and ready, please insert this following code in your child theme’s functions.php file.

    function add_shipping_payment_logos() { ?>
    
    <hr class="x-hr">
    <div id="x-section-0" class="x-section" style=" margin: 0px; padding: 0px; background-color: transparent;">
      <div class="x-container" style="margin: 0px auto; padding: 0px; ">
        <div class="x-column x-sm x-1-3" style="">
          <h2 class="man" style="text-align: center;"><i class="x-icon x-icon-globe" data-x-icon="" aria-hidden="true"></i></h2>
          <h6 style="text-align: center;">Free shipping worldwide</h6>
        </div>
        <div class="x-column x-sm x-1-3" style="">
          <h2 class="man" style="text-align: center;"><i class="x-icon x-icon-plane" data-x-icon="" aria-hidden="true"></i></h2>
          <h6 style="text-align: center;">Fedex<br>Express</h6>
        </div>
        <div class="x-column x-sm x-1-3" style="">
          <h2 class="man" style="text-align: center;"><i class="x-icon x-icon-check-circle" data-x-icon="" aria-hidden="true"></i></h2>
          <h6 style="text-align: center;">24 month warranty</h6>
        </div>
      </div>
    </div>
    <hr class="x-hr">
    
    <?php }
    add_action( 'woocommerce_single_product_summary', 'add_shipping_payment_logos', 25 );

    Please copy the code from here (http://pastebin.com/JFxDVan6) to preserve the unicode html entities or data-x-icon values.

    Hope this helps. Please let us know how it goes.

    #693398

    neckwear
    Participant

    Thank you! Im waiting for my host to update the php.

    I only installed the radio-button plugin cause i thought it may make things simpler, if i skip the plugin, is there a way for me to change the buttons?

    The logos that we want under the add to cart buttons are not the ones we have in the product text now, but an simple image with Visa,Fedex.. ect logos. Thats the one that we are having problems with adding so we’re not displaying it right now. (the site is not launched yet)

    When adding the code to increase the memory i get errors when acessing wpadmin:

    Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 84 bytes) in /home/neckwear/public_html/scottsberry/wp-includes/shortcodes.php on line 138

    Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 74 bytes) in /home/neckwear/public_html/scottsberry/wp-admin/includes/template.php on line 1294

    #693485

    Thai
    Moderator

    Hi There,

    Could you please try adding the following code into your wp-config.php file in the root of your WordPress installation.

    define( 'WP_MEMORY_LIMIT', '256M' );
    define( 'WP_MAX_MEMORY_LIMIT', '512M' );

    If that doesn’t help, please provide us with your FTP login credentials to check your current setup.

    Thanks!