npm install @oc-shopaholic/url-generation
import UrlGeneration from "@oc-shopaholic/url-generation";
UrlGeneration.init();
UrlGeneration.remove('page');
UrlGeneration.set('sorting', 'popularity|desc');
UrlGeneration.update();
Add field value in search string For example:
import UrlGeneration from "@oc-shopaholic/url-generation";
//URL http:://site.com?page=1
UrlGeneration.init();
UrlGeneration.set('sorting', 'popularity|desc');
UrlGeneration.update();
//URL http:://site.com?page=1&sorting=popularity|desc
UrlGeneration.set('brand', ['apple', 'samsung']);
UrlGeneration.update();
//URL http:://site.com?page=1&sorting=popularity|desc&brand=apple|samsung
Remove field value from search string For example:
import UrlGeneration from "@oc-shopaholic/url-generation";
//URL http:://site.com?page=1&sorting=popularity|desc&brand=apple|samsung
UrlGeneration.init();
UrlGeneration.set('brand');
UrlGeneration.update();
//URL http:://site.com?page=1&sorting=popularity|desc
Clear search string. For example:
import UrlGeneration from "@oc-shopaholic/url-generation";
//URL http:://site.com?page=1&sorting=popularity|desc&brand=apple|samsung
UrlGeneration.init();
UrlGeneration.clear();
//URL http:://site.com
© 2024, oc-shopaholic under GNU GPL v3.
Developed by Andrei Kharanenka.