The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.
 
 
Thread Tools Display Modes
  #1  
Old 12-27-2012, 05:40 AM
bonjour27333038's Avatar
bonjour27333038 is offline
 
Join Date: Dec 2012
Posts: 6
Question

Cant link to a product


Hi, I follow the article "How can I link to a particular product or category". Grab the URL from the address bar. For example, http://bonjour-nee.com/shop#!/~/product/category=4325417&id=18361401 . Every time I use this link, it always redirects to http://bonjour-nee.com/~/product/cat...17&id=18361401 and shows "Can't find the page". The different of these two url is "/shop#!/".

My web store front is http://bonjour-nee.com/shop .

Thanks!!

Alex
  #2  
Old 12-27-2012, 09:15 AM
Kess's Avatar
Kess Kess is offline
Senior Member
 
Join Date: Feb 2012
Posts: 2,071
Default

Quote:
Originally Posted by bonjour27333038 View Post
Hi, I follow the article "How can I link to a particular product or category". Grab the URL from the address bar. For example, http://bonjour-nee.com/shop#!/~/product/category=4325417&id=18361401 . Every time I use this link, it always redirects to http://bonjour-nee.com/~/product/cat...17&id=18361401 and shows "Can't find the page". The different of these two url is "/shop#!/".

My web store front is http://bonjour-nee.com/shop .

Thanks!!

Alex
In the source code of your page there is the following fragment:

Code:
 if (window.location.hash.indexOf('#!/') == 0) {
        window.location.replace(window.location.hash.substr(2));
    }
which removed the hash part form the links. Since this code is not a part of Ecwid, we cannot say what its purpose is. So please either delete this fragment from your HTML page, or, if this is a part of some important functionality on your site, please contact its developers and ask them to fix their script in such a way that it does not affect Ecwid URLs.
The Following User Says Thank You to Kess For This Useful Post:
bonjour27333038 (12-27-2012)
  #3  
Old 12-27-2012, 10:30 AM
bonjour27333038's Avatar
bonjour27333038 bonjour27333038 is offline
 
Join Date: Dec 2012
Posts: 6
Default

Thank you so much!! I'll check it.
  #4  
Old 02-12-2013, 08:46 AM
bonjour27333038's Avatar
bonjour27333038 bonjour27333038 is offline
 
Join Date: Dec 2012
Posts: 6
Default

Hi,

I integrate ecwid with NING ( http://www.ning.com ). I've ask their customer help service about this issue. The answer is they won't change any of their code.

I really like ecwid and still want to use it. Is there any other solution can make direct links to individual product in NING platform.

Thank you so much!!

Alex
  #5  
Old 02-13-2013, 08:55 AM
Eugene Rimmer's Avatar
Eugene Rimmer Eugene Rimmer is offline
Senior Member
 
Join Date: Jan 2011
Location: Ecwid headquarters
Posts: 7,765
Default

What is the address of the page where you use Ecwid there?
  #6  
Old 02-21-2013, 02:24 AM
bonjour27333038's Avatar
bonjour27333038 bonjour27333038 is offline
 
Join Date: Dec 2012
Posts: 6
Default

Quote:
Originally Posted by Eugene Rimmer View Post
What is the address of the page where you use Ecwid there?
Here is the front store http://bonjour-nee.com/shop
And this is one of the products
http://bonjour-nee.com/shop#!/~/prod...25&id=18404808

Thank you so much!!
  #7  
Old 02-27-2013, 03:49 PM
Lanna's Avatar
Lanna Lanna is offline
Ecwid Team
 
Join Date: Jan 2011
Posts: 2,675
Default

Hi,

Unfortunately due to technical limits of Ning platform, you can't get direct links to product pages as Ning code cuts # part of the link as explain in the above post.

But there're three ways to work this around:

1. The code in question used by Ning removes hash part only of specific format: #!/ So you can use Ecwid links of the old format. Examples:
for product - http://bonjour-nee.com/shop#ecwid:mo...oduct=18404808
for category - http://bonjour-nee.com/shop#ecwid:mo...tegory=4325124

You just need to insert necessary product and category ids (in the end of the links): How to get ids of product/category
Please, check, it should be working OK.

2. To create separate site pages and insert product HTML code there. In this case, you can have the page URL as you wish, like http://bonjour-nee.com/about-us

3. To use simple store links. The simple store works exactly the same as your store within the site.
__________________
Lana W.
Ecwid Customer Care Team

More tips and hints on Ecwid use in our Help Center

⬇ Please click Thanks if my reply helped you.

Thank Ecwid team on Twitter
The Following User Says Thank You to Lanna For This Useful Post:
bonjour27333038 (03-04-2013)
  #8  
Old 03-08-2013, 07:38 AM
bonjour27333038's Avatar
bonjour27333038 bonjour27333038 is offline
 
Join Date: Dec 2012
Posts: 6
Default

Hi,

Thank you so much for these solutions. Really helpful.
I take the first one, the old format link as the best choice cause I can write a script to redirect the page. It works and very nice.

This is my code:

Code:
if(location.href.indexOf('com/~/product/')>0) {
        location.href = 'http://bonjour-nee.com/shop#ecwid:mode=product&product='+location.href.match(/\d+$/);
    }
    
    if(location.href.indexOf('com/~/category/')>0) {
        location.href = 'http://bonjour-nee.com/shop#ecwid:mode=category&category='+location.href.match(/\d+/);
    }

Last edited by Eugene Rimmer; 03-11-2013 at 03:06 PM.
The Following User Says Thank You to bonjour27333038 For This Useful Post:
Matt Ecwid (03-20-2013)
  #9  
Old 04-06-2013, 12:32 AM
Justin Killeen's Avatar
Justin Killeen Justin Killeen is offline
 
Join Date: Aug 2012
Posts: 11
Default Question

Quote:
Originally Posted by bonjour27333038 View Post
Hi,

Thank you so much for these solutions. Really helpful.
I take the first one, the old format link as the best choice cause I can write a script to redirect the page. It works and very nice.

This is my code:

Code:
if(location.href.indexOf('com/~/product/')>0) {
        location.href = 'http://bonjour-nee.com/shop#ecwid:mode=product&product='+location.href.match(/\d+$/);
    }
    
    if(location.href.indexOf('com/~/category/')>0) {
        location.href = 'http://bonjour-nee.com/shop#ecwid:mode=category&category='+location.href.match(/\d+/);
    }
I'm having a similar issue but I did get the old ecwid product codes to work. What exactly does this code you wrote do? My biggest issue is that when someone checks out on PayPal they get redirected back to a nonexistent page, because of the #! removal. Does this code redirect to a new page? Is there any way I can create a custom 'thank you for your order page' and redirect to it instead?
  #10  
Old 04-08-2013, 01:48 PM
Matt Ecwid's Avatar
Matt Ecwid Matt Ecwid is offline
Ecwid Team
 
Join Date: Oct 2011
Posts: 4,947
Default

Quote:
Originally Posted by Justin Killeen View Post
I'm having a similar issue but I did get the old ecwid product codes to work. What exactly does this code you wrote do? My biggest issue is that when someone checks out on PayPal they get redirected back to a nonexistent page, because of the #! removal. Does this code redirect to a new page? Is there any way I can create a custom 'thank you for your order page' and redirect to it instead?
Hi,

In order to extend the code suggested here to fix the issue on your site as well, please try to use the solution below. It redirects all Ecwid internal URLs to their old-address-format analogues on a Ning site when Ning displays the 'Page not found' error.
  • Open your Ning Dashboard and navigate to the 'Custom code' tab
  • In the custom code textarea, put the following code:
Code:
<script>
var ecwidNingFix_storeUrl = 'http://www.example.com/store';
var ecwidNingFix_UrlMatches = window.location.href.match(/\/~\/([A-Za-z]+)\/?(.*)?/);
if (ecwidNingFix_UrlMatches) {
  var ecwidNingFix_newUrl = ecwidNingFix_storeUrl + '#ecwid:mode=' + ecwidNingFix_UrlMatches[1];
  if (ecwidNingFix_UrlMatches[2]) {
    ecwidNingFix_newUrl = ecwidNingFix_newUrl + '&' + ecwidNingFix_UrlMatches[2];
  }
  window.location.replace(ecwidNingFix_newUrl);
}
</script>
  • Do not forget to replace the 'http://www.example.com/store' part in the code above with your actual store page URL on your site

It should help - this code will work for the thank your page as well.
__________________
Matt K
Ecwid Team

Ecwid Guide for Beginners

Ecwid Help Center

Ecwid video tutorials
 
The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.

Tags
links, product

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:34 AM.
Powered by vBulletin® Version 3.8.11. Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.