none
help to create a code for sort option PRICE Low |High RRS feed

  • Question

  • Hi,

    I have registered and designed a website with wix.com.

    Until the 20th November 2017 I was able to import products to the Store via a CSV file. Wix have now removed the option.

    So using the Wix Code I managed to

    1. Created a collection, import all my products to the collection via CSV,

    2. Add a gallery to a separate page

    3. Connected the dataset to my collection

    4. Connected the Gallery to dataset

    I would like to add a “Sort” option above the Gallery.

    " SORT Price Low | High”  (two buttons for low and high)

     I have no knowledge of coding/script.

    So I added the question to the Wix code Forum and someone sent me this script:-

    import wixData from 'wix-data'; 

    $w.onReady( function() {

      $w("#button227").onClick( (event, $w) => {

        $w("#dresses1").setSort( wixData.sort()

          .descending("price");

      } );

     

      $w("#button228").onClick( (event, $w) => {

        $w("#dresses1").setSort( wixData.sort()

          .ascending("price");

        } );

    } );

    But when I added this script to the bottom of the page there is a red underline under the ; after descending("price")

    I sent another message to the Wix forum about this message but no reply.

    I appreciate if someone could give me any advice on this.

    Thanks

    • Moved by Bill_Stewart Monday, March 12, 2018 7:20 PM Off-topic/unanswerable
    Friday, January 12, 2018 2:40 PM

All replies

  • This is not a PHP forum and it is not a web design forum.  You will have to post to the WIX support forums for help.


    \_(ツ)_/

    Friday, January 12, 2018 2:43 PM