Jump to content

Unable to remove Currency and Product Categories on mobile - fix with jquery


SVCode

Recommended Posts

Despite having the correct hooks in place to remove the currency selector and product categories (six theme, standard cart, 7.2.3) they still showed up on mobile devices (but were removed on computers/desktops). Posting this here in case it helps others, bit of jquery to remove them using the ClientAreaFooterOutput hook. Has been raised with support as a potential bug.

 

<?php
function RemoveCurrency($vars)
{
$output .=  "<script type=\"text/javascript\">
			jQuery( \"select[name='currency']\" ).remove();
			</script>";

return $output;
}

add_hook("ClientAreaFooterOutput",1,"RemoveCurrency");

 

<?php
function RemoveProduct($vars)
{
       $output .=  "<script type=\"text/javascript\">
                              jQuery('optgroup[label=\"Product Categories\"]').remove();
                               </script>";

       return $output;
}

add_hook("ClientAreaFooterOutput",1,"RemoveProduct");

Edited by SVCode
Link to comment
Share on other sites

  • 2 years later...
  • 2 weeks later...
14 hours ago, carlos_tlewis said:

This is what I've been looking for... although I'm not 100% sure where it goes. Can someone shed some light on this? looked for 'ClientAreaFooterOutput'

it's a hook, so you would upload it to the /includes/hooks folder of your WHMCS, give it a .php filename and it should work on next page refresh.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated