Child Theme Functions File, and Quantity Heading Getting Cut Off

This topic has 6 replies, 3 voices, and was last updated 7 years, 2 months ago ago by Amzy Leel

  • Avatar: Marion2318
    Marion2318
    Participant
    October 16, 2017 at 16:22

    Hello! I need assistance on two small issues, please:

    1) In the shopping cart, the word “Quantity” no longer fits in its column and is getting overwritten (perhaps this will be resolved when I update the theme?). But I can’t update the theme until I resolve my second issue, below.

    2) Adding a snippet of code into the Child Theme’s functions.php file causes the site to crash. I confirmed with the plugin developer who provided me with the code that I should just add it to the end of the file, but it’s not working. When I had my programmer look at it, thinking I was misplacing it somehow, the same thing happened to him and he mentioned the php tag in the functions.php file doesn’t seem to have a closing tag, and might be closing in a different file? I was able to successfully add it to the Parent theme’s functions.php file, but can’t seem to get it into the Child Theme correctly, which I need to do so I can stay updated with the theme. The code is to fix some quantity arrows that were not appearing on an order form. Perhaps a recent update to the theme has maybe even fixed the issue this code is for? The code is this:

    // Add quantity buttons back
    add_filter( ‘wwof_filter_product_item_quantity’, ‘my_wwof_add_quantity_button’, 99, 2 );
    function my_wwof_add_quantity_button( $quantity_field , $product ) {

    $quantity_field = str_replace(‘<div class=”quantity”>’, ‘<div class=”quantity buttons_added”><input type=”button” value=”-” class=”minus”>’, $quantity_field);
    $quantity_field = str_replace(‘</div>’, ‘<input type=”button” value=”+” class=”plus”></div>’, $quantity_field);

    // Return the result
    return $quantity_field;
    }

    Thank you for any help you can provide.

    Please, contact administrator
    for this information.
    5 Answers
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    October 17, 2017 at 11:16

    Hello,

    1) Yes, you need to update theme to version 4.9. I have installed new version and re-named the old one.

    2) Don’t see the problem if you add code with correct symbols like ” and ‘. Check the functions.php of child theme, everything works fine.

    Regards

    Avatar: Marion2318
    Marion2318
    Participant
    October 17, 2017 at 16:46

    Hello thank you for your quick response. I do see the code in the child functions file now, thank you. I presume I can now delete the theme V4.4 and everything will run as expected now?

    Thank you again.

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    October 18, 2017 at 11:02

    Hello,

    Yes, you can delete the old version of theme.

    Regards

    Avatar: Marion2318
    Marion2318
    Participant
    October 18, 2017 at 18:41

    Thank you!

    Avatar: amzy
    Amzy Leel
    Participant
    October 19, 2017 at 07:22

    You are welcome.

    Do not hesitate to ask if you have any other question (in new post / topic)

    Regards,

  • Viewing 6 results - 1 through 6 (of 6 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.