WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
cart shows slug instead of useful text (9 posts)

  1. kittensforgood
    Member
    Posted 1 year ago #

    I'm trying to make a woocommerce site for the first time.

    The problem I am running into is that I want the user to be able to enter some unique text for the front of a T shirt. So they would need to write something like "Cats & Dogs" but in the cart and throughout the checkout process this would turn into "cats-dogs".

    As you can see, this is a major problem because, as the seller, I have the wrong information. How can I fix this please?

    Thank you.

    P.S. I edited variable.php to "hack" in the text field where the user can type with this code:

    <input type="text" id="<?php echo esc_attr( sanitize_title($name) ); ?>" value="Enter text here" maxlength="35" size="38" onkeyup="caps(this)"
    name="attribute_<?php echo sanitize_title($name); ?>"/>

    And then in the product I just type a specific phrase for the attribute and this box becomes enabled.

    http://wordpress.org/extend/plugins/woocommerce/

  2. IgniteWoo
    Member
    Posted 1 year ago #

    It's "sanitize_title( $name )" doing this. You're using a WP function only meant to sanitize post/page titles for making post/page slugs.

  3. kittensforgood
    Member
    Posted 1 year ago #

    I tried taking out the sanitize_title and just the sanitize but this did not work. Quite frankly, I know nothing about wordpress coding... but I tried a variety of things.

    How would I go about making the change I want (making the cart and checkout process use the user-entered text "as-is"?

    Thank you for the quick reply too.

  4. IgniteWoo
    Member
    Posted 1 year ago #

    Dunno off-hand, I'd have to read through the code to find out. Your best bet is to hire someone that knows what they're doing.

  5. kittensforgood
    Member
    Posted 1 year ago #

    hmm, well that stinks, I was thinking this wasn't too complex. hence, trying to do it myself. I'm pretty decent with html and web stuff in general... but all these other weird tongues have taken me for a loop. woocommerce's site has pretty dismal support/tutorials it seems too.

  6. IgniteWoo
    Member
    Posted 1 year ago #

    WooThemes and WooCommmerce developers are not in a position to teach anyone how to read and write PHP ;-) That burden is upon you. Or, as I suggested, just give a competent dev some bux to do it for you and be done with it. When they get done, read their code to see how they did it. No higher education is free! Besides you're opening a store - to make money - spend a little if required and write it off as a business expense ;-)

  7. kittensforgood
    Member
    Posted 1 year ago #

    Oh I couldn't agree more! I am not looking to learn an entire language! :)

  8. kittensforgood
    Member
    Posted 1 year ago #

    anyone else?

  9. kittensforgood
    Member
    Posted 1 year ago #

    I would really like if anyone can tell me where I can learn to swap out the slugs in the cart for the actual user-submitted text. Thank you.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic