Knowledgebase:
Sort By & Page View error 9.00052
Posted by , Last modified by on 09 January 2016 03:46 PM

Disclaimer: This will work for stores on Miva Version 9.0 or newer. Note that this will require making template changes. Make sure you make sure you are aware of what version was active before any changes are made. These edits are low-risk but if you feel uncomfortable with making these changes then we advise you to seek help from a developer.

 

Objective: These are instructions will aid in fixing the Sort By and View Page drop downs on product list pages.

 

Issue(s): I installed the newest version of the Suivant or Coustic theme. I tried adding a product to cart but the blue arrows infinitely spin.

 

 

 Pages that will need these changes:

 

            CTGY: Category Product List Layout

            PLST: Product List Layout

            PROD: Related Product List Layout

            SRCH: Search Results Layout

            WISH: Wish List Items Layout

            WLST: Wish Lists Layout

            ABAL: Customer Credit History List Layout

 

            Also, any page that contains the CSSUI Product List item, the CSSUI Wish Lists item, the CSSUI Wish List Items item, or the CSSUI Customer Credit History item assigned (outside of the above listed pages)

 

Two places will need to be altered in each of the above listed templates

            Note* if you search for "get" (including the quotes) on the page, you'll find the two get forms for Sort By and Per Page. These are the two locations that need to be altered. We're going to remove the form and hidden inputs surrounding the <select> statement, and alter the onchange event. Make special note of any additional hidden inputs (for people who may have customized their forms to include other data). If this is the case, you'll need to include those parameters in the onchange just as is done below with the default ones.

 

Step 1: Find the two forms for Sort_By and Per_Page

Step 2: Replace the

<select> tag's onchange="this.form.submit();" attribute to: onchange="window.location.href='&mvtj:urls:_self:auto_sep;Per_Page=' + encodeURIComponent( '&mvtj:global:Per_Page;' ) + '&amp;Sort_By=' + encodeURIComponent( this.options[ this.selectedIndex ].value );"

NOTE: the "this.options[ this.selectedIndex ].value" portion will go with whatever <select> tag you're in...

Example: Sort_By select would look like so:                

<select name="Sort_By" id="Sort_By" onchange="window.location.href='&mvtj:urls:_self:auto_sep;Per_Page=' + encodeURIComponent( '&mvtj:global:Per_Page;' ) + '&amp;Sort_By=' + encodeURIComponent( this.options[ this.selectedIndex ].value );">

Per_Page select would look like so:   

<select name="Per_Page" id="Per_Page" onchange="window.location.href='&mvtj:urls:_self:auto_sep;Per_Page=' + encodeURIComponent( this.options[ this.selectedIndex ].value ) + '&amp;Sort_By=' + encodeURIComponent( '&mvtj:global:Sort_By;' );">

 

NOTE: The change is a little different for the Suivant theme Pagination. Attached is the code needed to make that template change.

Step 3: Remove the two portions for each of the two selects: (the following example is for CSSUI Product List, but the other three component modules will follow the same structure minus the Category_Code and Product_Code inputs)

                        <!-- START REMOVE -->

                        <form method="get" action="&mvte:urls:_self:auto;">

                                    <input type="hidden" name="Screen" value="&mvte:global:Screen;" />

                                    <input type="hidden" name="Store_Code" value="&mvte:global:Store_Code;" />

                                    <input type="hidden" name="Category_Code" value="&mvte:global:Category_Code;" />

                                    <input type="hidden" name="Product_Code" value="&mvte:global:Product_Code;" />

                                    <input type="hidden" name="Search" value="&mvte:global:Search;" /> 

                                    <input type="hidden" name="Sort_By" value="&mvte:global:Sort_By;" />

                        <!-- END REMOVE -->

 

                        and 

 

                        <!-- START REMOVE -->

                                    <noscript><input type="submit" value="go"></noscript>

                        </form>

                        <!-- END REMOVE -->

Step 4: Click Update to save the template

Step 5: TEST IN RUNTIME!

 

Side Note: if the CSSUI Product List item is assigned to any custom pages (not CTGY or PROD) and is used as a category list OR a related product list, you will need to append the Category_Code or Product_Code as a parameter, since the generated _self URL will NOT contain those values. Example: <select name="Sort_By" id="Sort_By" onchange="window.location.href='&mvtj:urls:_self:auto_sep;Per_Page=' + encodeURIComponent( this.options[ this.selectedIndex ].value ) + '&amp;Sort_By=' + encodeURIComponent( '&mvtj:global:Sort_By;' ) + '&amp;Search=' + encodeURIComponent( '&mvtj:global:Search;' ) + '&amp;Product_Code=' + encodeURIComponent( '&mvtj:global:Product_Code;' );">

 

Default values of selects for each of the four component modules that will need their templates updated:

 

CSSUI Product List:

<select name="Sort_By" id="Sort_By" onchange="window.location.href='&mvtj:urls:_self:auto_sep;Per_Page=' + encodeURIComponent( '&mvtj:global:Per_Page;' ) + '&amp;Sort_By=' + encodeURIComponent( this.options[ this.selectedIndex ].value ) + '&amp;Search=' + encodeURIComponent( '&mvtj:global:Search;' );">

<select name="Sort_By" id="Sort_By" onchange="window.location.href='&mvtj:urls:_self:auto_sep;Per_Page=' + encodeURIComponent( this.options[ this.selectedIndex ].value ) + '&amp;Sort_By=' + encodeURIComponent( '&mvtj:global:Sort_By;' ) + '&amp;Search=' + encodeURIComponent( '&mvtj:global:Search;' );">

CSSUI Wish Lists:

<select name="Sort_By" id="Sort_By" onchange="window.location.href='&mvtj:urls:_self:auto_sep;Per_Page=' + encodeURIComponent( '&mvtj:global:Per_Page;' ) + '&amp;Sort_By=' + encodeURIComponent( this.options[ this.selectedIndex ].value ) + '&amp;WishListSearch=' + encodeURIComponent( '&mvtj:global:WishListSearch;' );">

<select name="Per_Page" id="Per_Page" onchange="window.location.href='&mvtj:urls:_self:auto_sep;Per_Page=' + encodeURIComponent( this.options[ this.selectedIndex ].value ) + '&amp;Sort_By=' + encodeURIComponent( '&mvtj:global:Sort_By;' ) + '&amp;WishListSearch=' + encodeURIComponent( '&mvtj:global:WishListSearch;' );">

CSSUI Wish List Items:

<select name="Sort_By" id="Sort_By" onchange="window.location.href='&mvtj:urls:_self:auto_sep;WishList_ID=' + encodeURIComponent( '&mvtj:global:WishList_ID;' ) + '&amp;Per_Page=' + encodeURIComponent( '&mvtj:global:Per_Page;' ) + '&amp;Sort_By=' + encodeURIComponent( this.options[ this.selectedIndex ].value );">

<select name="Per_Page" id="Per_Page" onchange="window.location.href='&mvtj:urls:_self:auto_sep;WishList_ID=' + encodeURIComponent( '&mvtj:global:WishList_ID;' ) + '&amp;Per_Page=' + encodeURIComponent( this.options[ this.selectedIndex ].value ) + '&amp;Sort_By=' + encodeURIComponent( '&mvtj:global:Sort_By;' );">

CSSUI Customer Credit History:

 <select name="Sort_By" id="Sort_By" onchange="window.location.href='&mvtj:urls:_self:auto_sep;Per_Page=' + encodeURIComponent( '&mvtj:global:Per_Page;' ) + '&amp;Sort_By=' + encodeURIComponent( this.options[ this.selectedIndex ].value );">

<select name="Per_Page" id="Per_Page" onchange="window.location.href='&mvtj:urls:_self:auto_sep;Per_Page=' + encodeURIComponent( this.options[ this.selectedIndex ].value ) + '&amp;Sort_By=' + encodeURIComponent( '&mvtj:global:Sort_By;' );">

 

 



Attachments 
 
 untitled.txt (1.22 KB)
(0 vote(s))
This article was helpful
This article was not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below. This is required to prevent automated registrations and form submissions.

Help Desk Software by Kayako support.miva.com/supportsuite/index.php?