WordPress.org

Ready to get started?Download WordPress

Forums

WP eCommerce
[resolved] Unique product in shop - no need for "Continue Shopping" (18 posts)

  1. palmerstoneroad
    Member
    Posted 1 month ago #

    Hi,

    I have only one product on my shop so the "Continue Shopping" link in the Fancy Notification become redundant.

    Can you suggest ways how to disable it?

    thanks!

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

  2. whitelamp
    Member
    Posted 1 month ago #

    I've looked at the code that generates it and it seems to have
    class='continue_shopping'
    so your best bet is to hide it using CSS in your theme's CSS file.

  3. whitelamp
    Member
    Posted 1 month ago #

    My guess is you should have a look at:
    wpsc-core/js/wp-e-commerce.js
    1163: jQuery( 'div.wpsc_variation_forms' ).on( 'change', '.wpsc_select_variation', function() {

    then perhaps create your own class and function

  4. whitelamp
    Member
    Posted 1 month ago #

    Sorry, wrong thread.

  5. palmerstoneroad
    Member
    Posted 1 month ago #

    Hi whitelamp,

    thanks for this.

    I have been looking in WPEC CSS file in my theme folder but there I am not able to find where the for "continue_shopping" instruction actually is.

    Can you give me more details about the right place to look for it?

    thanks again for your help, much appreciated

  6. whitelamp
    Member
    Posted 1 month ago #

    At a guess - go to wp-content/themes/yourtheme/wpsc-default.css and
    add:

    .continue_shopping {
    display: none;
    }

    but that is not tested or anything.

  7. palmerstoneroad
    Member
    Posted 1 month ago #

    yes, I have tried this option but that instruction does not move anything in the fancy notification box :)

  8. palmerstoneroad
    Member
    Posted 1 month ago #

    Do you think it's possible to remove the link with javascript and jQuery?

    If yes, what is the file to edit?

    thanks!

  9. whitelamp
    Member
    Posted 1 month ago #

    Really, simplest is to hide it with CSS. If my suggestion doesn't work then try using firebug or a developer toolbar to see why.

  10. Jeff Pye Brook
    Member
    Posted 1 month ago #

    Mihai from Instinct pointed out to me that you can change the content with a simple filter.

    Hook wpsc_add_to_cart_json_response and you can change the content of the fancy notification to whatever you want.

    See WP-e-Commerce\wpsc-components\theme-engine-v1\helpers\ajax.php at line 193.

  11. palmerstoneroad
    Member
    Posted 1 month ago #

    I have tried, adding

    .continue_shopping {
    display: none;
    }

    to wp-content/themes/mytheme/wpsc-default.css

    but the link it's still there.

    Curious thing I am not able to locate the CSS where instruction continue_shopping is included.

    Chrome Developer toolbar does still refer to wpsc-default.css, weird that the 'display: none' instruction is simply ignored.

    I am not a developer so I cannot go further in my analysis; any suggestion would be more than appreciated.

    thanks!

  12. palmerstoneroad
    Member
    Posted 1 month ago #

    Hi Jeff Pye Brook,

    just saw your comment now.

    what you mean by 'Hook'? Sorry, I am not a developer so any further explanation would help me following your suggestion :)

    thanks!

  13. Jeff Pye Brook
    Member
    Posted 1 month ago #

    I'll create a little plugin for you to use that removes the notification, give me a little bit and I will post a download link.

  14. Jeff Pye Brook
    Member
    Posted 1 month ago #

  15. palmerstoneroad
    Member
    Posted 1 month ago #

    Hi Jeff Pye brook,

    thank you so much for this. Simply amazing :)

    Out of curiosity: any particular reason you choose to go with a plugin instead of editing WPEC code to remove the link?

    thanks again!

  16. Out of curiosity: any particular reason you choose to go with a plugin instead of editing WPEC code to remove the link?

    Making another plugin is better: if you modify WPEC directly then you'll lose those changes when the plugin is updated. By doing it the way that Jeff did then your changes will remain in effect even if the WPEC plugin is updated.

  17. Jeff Pye Brook
    Member
    Posted 1 month ago #

    @Jan is exactly right. The developers work hard to try to maintain backwards compatibility so the hook we have in the plugin should live from version to version.

    One of the best things about WPeC is the plethora of hooks and filters that it has to change the behavior. You just have to be willing to dive in and identify them. If someone wanted to learn the code base I'm sure there would be an opportunity to help create more accessible documentation for the community :)

    The other reason for keeping the changes separate is that if you run into a WPeC technical support issue the first thing you would want to do is disable all extraneous plugins and see if the the issue remains a problem. As soon as you change something in the code base all bets are off as to if someone will be able ( or willing ) to help you diagnose the problem.

    For each future version you upgrade into you will want to do a really quick check to be sure the formatting of the notice and the processing is OK.

  18. palmerstoneroad
    Member
    Posted 1 month ago #

    thanks Jeff Pye Brook and Jan Dembowski for clarify this point, it helps me acquire more knowledge of how WP and WPeC work.

    I am more than willing to learn WPeC code base but I really don't know where to start expect from the documentation available on http://getshopped.org, which I still found really basic.

    thanks for help

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.