leeego Posted June 9, 2013 Share Posted June 9, 2013 (edited) How can I avoid that the product attributes get pushed at the end of the URL as soon as I select a product option? Example: myshop.com/presta/music-ipods/1-ipod-nano.html becomes: myshop.com/presta/music-ipods/1-ipod-nano.html#/disk_space-8gb/color-black If I look at the official PrestaShop demo shop, I can see that it doesn't happen there (e.g. http://demo-store.pr...28-handbag.html) Is there a built-in way to have that kind of behavior or do I need to buy a module for that? Edited July 29, 2013 by leeego (see edit history) Link to comment Share on other sites More sharing options...
leeego Posted July 29, 2013 Author Share Posted July 29, 2013 If I'm unclear in my question, please let me know. Link to comment Share on other sites More sharing options...
javamobiletech Posted September 3, 2013 Share Posted September 3, 2013 REALLY wanna know too, but it looks like the demoshop loose the ability to link to a product, exactly as the customer purchased Example, if you click at the link in the cart at the demoshop or in the orderconfirm email, the preselected choice are gone... Maybe it will confuse and scare customers and wondering if they purchased the correct model ??? Example in one of my shops: http://www.living-in-harmony.dk/12-spisebord-langbord-harmony.html#/bord_harmony_samling_bentype-hjoslashrnesamling_b_traeligben_12_x_12_cm/bord_str_harmony-100_x_220_cm/bord_till%C3%A6gsplader-2_stk_tillaeliggsplader But surely an ugly URL and annoying for "browser-back" navigation, should be solved without loosing EXACT links as well Link to comment Share on other sites More sharing options...
leeego Posted September 4, 2013 Author Share Posted September 4, 2013 If you have a lot of options per product, it may make sense to put all the parameters to the URL, yes. But in my case there is only two attributes with each three values. So i wouldn't mind if the user has to reselect his options. So the fact that the user has to click the back button multiple times to actually get back to where he wants, has much more impact to my shop. If you one would want short URLs and the one click back button it could be probably solved with a cookie, but I'm not experienced enough with PrestaShop to say that this is the way to go. Link to comment Share on other sites More sharing options...
javamobiletech Posted September 4, 2013 Share Posted September 4, 2013 Sure, hope if we keep the tread alive, one of the Presta legends tell us how it´s done on the demosite MUST be a standard Presta feature, when it´s done on the global demosite... Link to comment Share on other sites More sharing options...
leeego Posted September 4, 2013 Author Share Posted September 4, 2013 If it's a standard feature, they've made a god job to hide it Link to comment Share on other sites More sharing options...
javamobiletech Posted September 4, 2013 Share Posted September 4, 2013 Ohhhh my, we are looking at an old Presta The javascript file is from 2011 - guess we can locate the solution in the product.js file Link to comment Share on other sites More sharing options...
Tradeswiss Posted September 24, 2013 Share Posted September 24, 2013 Hey Guys, Any update of your problem ? I need a solution too Link to comment Share on other sites More sharing options...
leeego Posted October 30, 2013 Author Share Posted October 30, 2013 Hello Seirei Sadly, I didn't get any answer so far. It would be cool if someone from PrestaShop could tell us, if they use an addon in their demo store to get the desired results, or if it's already built into PrestaShop. Link to comment Share on other sites More sharing options...
gonebdg - webindoshop.com Posted October 31, 2013 Share Posted October 31, 2013 file product.js > function getProductAttribute() Search, remove or comment following lines (comment the lines by adding "//" without quotes) for (var i in attributesCombinations) for (var a in tab_attributes) if (attributesCombinations[i]['id_attribute'] === tab_attributes[a]) request += '/'+attributesCombinations[i]['group'] + '-' + attributesCombinations[i]['attribute']; request = request.replace(request.substring(0, 1), '#/'); AND this line to prevent page reloading window.location = url + request; ... don't know what would be affected then ... 1 Link to comment Share on other sites More sharing options...
leeego Posted November 1, 2013 Author Share Posted November 1, 2013 (edited) Hmm, this seems to break product combinations: If e.g. a product has two attributes (color and size), only the selected value of the first attribute (color) will be correctly taken to the cart. The value of the second attribute (size) falls back to its default value. I don't know if this is related to my shop as I did some customization in that part. Can anyone else confirm this problem? Edited November 1, 2013 by leeego (see edit history) Link to comment Share on other sites More sharing options...
gonebdg - webindoshop.com Posted November 1, 2013 Share Posted November 1, 2013 I don't have such problem with Default Prestashop v.1.5.6.0 on my localhosttested with the default product = iPod Link to comment Share on other sites More sharing options...
leeego Posted November 5, 2013 Author Share Posted November 5, 2013 You're right. It works on a default PrestaShop 1.5.6.0 installation. Now I only have to figure out why there's a problem in my shop Thanks for your help! Link to comment Share on other sites More sharing options...
editorstefan Posted March 26, 2014 Share Posted March 26, 2014 Should I do this in order to get better SEO? Or doesnt it matter? Link to comment Share on other sites More sharing options...
goodluck11 Posted November 3, 2015 Share Posted November 3, 2015 this solution dont works in my 1.5.6, I can solve the problem comment this lines: // build new request /*for (var i in attributesCombinations) for (var a in tab_attributes) if (attributesCombinations['id_attribute'] === tab_attributes[a]) request += '/'+attributesCombinations['group'] + '-' + attributesCombinations['attribute'];*/ request = request.replace(request.substring(0, 1), '#/'); ----> if you delete this line you can't make the request and the button add to cart don't works. url = window.location + ''; Link to comment Share on other sites More sharing options...
Bill Dalton Posted November 3, 2015 Share Posted November 3, 2015 It actually isn't a bug, its a feature. Search Engines ignore an anchor tag, everything after one of these # The actual url that is indexed by Google or Bing is the default product url. We see multiple addresses but spiders only see one unique url because the anchor text is ignored. Everything after the # tag needs a browser to make it useful. It is the browser software that uses the anchor for matching up to specific content. It is fantastic to send a link to a customer that shows them the exact color and size they wanted to see. Link to comment Share on other sites More sharing options...
rolinb Posted November 4, 2016 Share Posted November 4, 2016 (edited) We sell cable products, each cable product has approx 30 'Length' Combinations to choose from. We list these products in Google Merchant Center (Google Shopping) with each Combination its own product. A valid Google Shopping listing requires a link back to a page that shows that product at the same price as what it's listed at in Google. The "#/" feature in PrestaShop product links work great (i.e., domain.com/category/main-product#/length-4_meter). It links to the product and selects the combination automatically so the right price and product are displayed. However, 1 problem exists with PrestaShop's "#/" anchor tag feature... Google Merchant accepts it in the XML upload, but Google Search doesn't index the 'Length' combinations because it thinks they are Anchor links not Page links. Only the cables main product is indexed and it's not a product by itself, it needs a Length... so Google Merchant randomly selects one of the 30 lengths to display in Google Shopping. Google support tried to figure it out and found nothing wrong with my listing or XML, their official response was 'Spend more in AdWords and more lengths will appear'... Code for they have no clue. Can someone with epic knowledge of PrestaShop confirm I can just remove "#" from "#/" in the snippet of product.js code below (theme/js/product.js) and clear my cache? // build new request for (var i in attributesCombinations) for (var a in tab_attributes) if (attributesCombinations[i]['id_attribute'] === tab_attributes[a]) request += '/'+attributesCombinations[i]['group'] + attribute_anchor_separator + attributesCombinations[i]['attribute']; request = request.replace(request.substring(0, 1), '#/'); url = window.location + ''; Thanks in advance! Edited November 5, 2016 by rolinb (see edit history) Link to comment Share on other sites More sharing options...
daniel69 Posted February 10, 2017 Share Posted February 10, 2017 Hello, sorry to open this post, but please and i have exactly the same issue than Leego : How avoid attributes get pushed at the end of my URL as soon as I select a product option because when the user has to click the back button mutilple time to delete this attributes choice. Please help me I use PS 1.6.0.9 Link to comment Share on other sites More sharing options...
zerdahk786 Posted April 19, 2018 Share Posted April 19, 2018 any solution yet to the back button? both mobile and desktop has the same issue. many customers complain to keep clicking back from combination and then they leave the site loss of customer. Link to comment Share on other sites More sharing options...
waizrahman Posted June 21, 2018 Share Posted June 21, 2018 this plugin removes most of them, but in prcesss of improving futher so that all parameters after # tag are removed.... .https://addons.prestashop.com/en/url-redirects/31273-seo-friendly-urls.html Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now