WordPress.org

Forums

WP eCommerce
[resolved] wp-ecommerce - fancy purchase notifications text (8 posts)

  1. digitalfuse
    Member
    Posted 1 year ago #

    Hi,

    I'm looking to change the text within the WP-ecommerce fancy notification pop-up window. Just minor amends needed, things like changing the word 'cart' to 'basket' etc. I've looked through the PHP/.js files, but cannot find the text anywhere to edit. If anyone could point me in the right direction. I'd appreciate it!

    Thanks!

    https://wordpress.org/plugins/wp-e-commerce/

  2. JCW Hosting
    Member
    Posted 1 year ago #

    Hi

    Have a look here:
    \wp-content\plugins\wp-e-commerce\wpsc-includes\ajax.functions.php
    The text is there that you may change.

    I have another problem, once an item is added to cart the text is floating to the left, how or where can this be changed to be either static or on top of the products?

    Thanks.

  3. digitalfuse
    Member
    Posted 1 year ago #

    Hi thanks for you reply.

    I had a look in the file you mentioned, but couldn't find the text to amend. I simply wish to change the word 'cart' to 'basket'. Any more info on this would be greatly appreciated.

  4. Ray Ardinanda
    Member
    Posted 1 year ago #

    Hi there,

    Ray here with WP eCommerce support. Have you try changing this function on

    function fancy_notification_content( $cart_messages ) {
    $siteurl = get_option( 'siteurl' );
    $output = '';
    foreach ( (array)$cart_messages as $cart_message ) {
    $output .= "<span>" . $cart_message . "</span>
    ";
    }
    $output .= "" . __( 'Go to Checkout', 'wpsc' ) . "";
    $output .= "" . __( 'Continue Shopping', 'wpsc' ) . "";
    return $output;
    }

    on /wpsc-components/theme-engine-v1/helpers/product.php ?

    I believe it is the $cart_messages that you need to tweak. perhaps a little PHP string substitution.

    Thank you,
    Ray

  5. Justin Sainton
    Member
    Plugin Author

    Posted 1 year ago #

    Adding the following code to your functions.php folder should do the trick. Note: Please don't change core files :)

    function digitalfuse_custom_notification( $response ) {
    
    	if ( ! isset( $response['fancy_notification'] ) ) {
    		return $response;
    	}
    
    	$response['fancy_notification'] = str_replace( array( 'cart', 'Cart' ), array( 'basket', 'Basket' ), $response['fancy_notification'] );
    
    	return $response;
    }
    
    add_filter( 'wpsc_add_to_cart_json_response', 'digitalfuse_custom_notification' );
  6. JCW Hosting
    Member
    Posted 1 year ago #

    Hi Justin

    Will this enable me to move the fancy notification to another spot or is it more a reply for digitalfuse?

    Let me know and thanks for the reply.

    Regards

  7. Justin Sainton
    Member
    Plugin Author

    Posted 1 year ago #

    Hi JCW Hosting,

    That was for digitalfuse.

    To move the fancy notification to another spot, depending on your theme and what the Javascript is doing to position in "centrally", you may be able to tweak it via CSS, or reposition it programmatically via JS on the custom event that is triggered for fancy notifications.

  8. JCW Hosting
    Member
    Posted 1 year ago #

    Hi
    Thanks, struggle a bit with it, working on the chronology theme, website is madeinprincealbert.co.za.

    But will keep looking at it, thanks again.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic