Forum Replies Created

Viewing 15 replies - 1 through 15 (of 24 total)
  • Thread Starter ivcatalina

    (@ivcatalina)

    This is resolved. The problem was actually to do with Cloudflare.

    Thread Starter ivcatalina

    (@ivcatalina)

    THANK YOU!! You are a genius!

    Thread Starter ivcatalina

    (@ivcatalina)

    This worked, THANK YOU!! Last question, if we wanted to change it to say be socks and accessories to be display 1 text, everything else to display something else, how would we add on ‘accessories’ to this condition?

    Thanks again!!

    Thread Starter ivcatalina

    (@ivcatalina)

    This gives me an error (invalid function name). This is my code:

    add_action( ‘woocommerce_single_product_summary’, ‘cat_condition’, 35);

    if ( is_product() ) {
    global $post;
    $socks = 116; // category id for socks
    $terms = get_the_terms( $post->ID, ‘product_cat’ ); // no socks here
    foreach ($terms as $term) {
    if ($socks == $term->term_id) {
    print ‘<p>show me function</p>’;
    } else {
    print ‘<p> show this function</p>’;
    }
    }
    }

    And thank you again for helping me with this!!

    Thread Starter ivcatalina

    (@ivcatalina)

    Thank you! It’s close, i’m sure, but on the frontend it shows this:

    show this

    show this

    show this

    show this

    show this

    .And on the pages of the ‘socks’ category it shows this:

    show this

    show this

    show this

    show this

    show me

    So I just need to work out how to get rid of all the ones before it :). I wonder if it’s because there are multiple categories associated with it? So when the product sits inside ‘socks’ and ‘shoes’ for example, it’s showing ‘show this’ (for shoes) and ‘show me’ (for socks) as that’s what applies. Is there a way around this, do you know?

    • This reply was modified 8 years ago by ivcatalina.
    • This reply was modified 8 years ago by ivcatalina.
    • This reply was modified 8 years ago by ivcatalina.
    Thread Starter ivcatalina

    (@ivcatalina)

    Thanks! So are you saying my code should be:

    <?php if (is_product()) {

    global $post;
    $terms = get_the_terms( $post->ID, ‘socks’ );

    foreach ($terms as $term) {
    if ($socks == $term->term_id) { ?>

    <p>show me</p>
    <?php
    } else {
    ?>
    <p> show this</p>
    <?php
    }
    ?>

    That’s giving me an error. I have this in variable.php (through my theme). It is showing in the correct place in here, though.

    • This reply was modified 8 years ago by ivcatalina.
    Thread Starter ivcatalina

    (@ivcatalina)

    Infact changing it in the description page doesn’t add it to individual products. This is for products rather than the category page.

    Thread Starter ivcatalina

    (@ivcatalina)

    Thank you for replying! That’s showing the ‘show this’ text now, but not switching it out if the product category is ‘socks’. Am thinking that first part may be wrong.

    I can do it under there but I need the text to show under the ‘Add to Cart’ button and can’t get it in the right place.

    Thread Starter ivcatalina

    (@ivcatalina)

    Their support forum is closed and they recommended we posted here. I am working on the site for a friend so do not have the login for the site to create a support ticket. I was hoping someone here might of done the same thing already.

    Thread Starter ivcatalina

    (@ivcatalina)

    I managed to fix it by adjusting the memory limit and max execution time on my server.

    Thread Starter ivcatalina

    (@ivcatalina)

    Let me try to explain a little better.. I need it as a header in that it fills the entire page at 100% width. Because this is the only page it is needed on, I thought I could maybe just add it to the ‘page’ that it needs to go onto as coding. But the template is telling that page to give it margin and padding (so that the text sits in the middle of the page, and not against the wall). So I figured I needed to add it as a separate header, so that it doesn’t get caught up in these stylesheets.

    Thread Starter ivcatalina

    (@ivcatalina)

    We don’t need the header elsewhere, just on this page. But if I add it as regular content if conforms to the margins of the content page (if that makes sense). I need the header at 100% width.

    Thread Starter ivcatalina

    (@ivcatalina)

    Any ideas anyone?

    Thread Starter ivcatalina

    (@ivcatalina)

    Thank you all. Turns out I just needed to amend my ‘wp-config’ file. I checked the dates and this was the file that kept getting overwritten. I put back in my details and it worked. PHEW! Thank you all! Had a real panic there. Think i’ll do a backup now as a ‘just incase’.

    Thread Starter ivcatalina

    (@ivcatalina)

    UPDATE: On Saturday, I changed the email address in my profile on the server and that is when I believe it brought the site down. This is when it states the ‘last modified’ date is on my WordPress folder. To test this, I just changed the email address back and the last modified date changed to today’s date and time. Have I just lost all the content? Please tell me there’s someway to retrieve it and it’s in the back somewhere….

Viewing 15 replies - 1 through 15 (of 24 total)