Post by labeshops » Sat Aug 01, 2020 8:39 pm

any idea why links in information page are no longer relavite links for multistores? I used to be able to (v2.2) use "/login" as a link for example and oc would automatically make it "storeurl/login" with the storeurl being the store it was clicked on, but it doesnt seem to do that anymore in v3? It is working with links in the footer, but not on info pages like www.allwicca (dot) com/affiliate-program. It was adding http:// to the /login link.
Last edited by labeshops on Mon Aug 03, 2020 7:41 pm, edited 3 times in total.

Running Opencart v3.0.3.2 with multi-stores from https://www.labeshops.com which has links to all my stores.

Image


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by JNeuhoff » Sat Aug 01, 2020 9:37 pm

any idea why links in information page are no longer dynamic for multistores?
No, because your details are too vague to be of a useful help.

For a start, what exact links are you talking about, on what information page? OpenCart version? Any other extensions? Any URL?

MHC Web Design
Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Rich Snippets * Google Tag Manager * Export/Import Tool * SpamBot Buster


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by labeshops » Sat Aug 01, 2020 9:44 pm

JNeuhoff wrote:
Sat Aug 01, 2020 9:37 pm
any idea why links in information page are no longer dynamic for multistores?
No, because your details are too vague to be of a useful help.

For a start, what exact links are you talking about, on what information page? OpenCart version? Any other extensions? Any URL?
As I already said, I am using v3 ( v3.0.3.2 as stated in my signature to be exact), and creating links on an info page. The sample URL is in my original post too so not sure what you were reading.

Running Opencart v3.0.3.2 with multi-stores from https://www.labeshops.com which has links to all my stores.

Image


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by JNeuhoff » Sat Aug 01, 2020 10:08 pm

OK, I got it now. It's a known summernote editor issue, with a possible fix proposed here: https://github.com/summernote/summernote/issues/1037

Your links shouldn't be auto-prefixed with the 'https://' nor 'http://' when you want relative URLs.

MHC Web Design
Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Rich Snippets * Google Tag Manager * Export/Import Tool * SpamBot Buster


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by labeshops » Sat Aug 01, 2020 10:58 pm

ah yeah, that is what it is doing. I will try the fix, thanks.

Running Opencart v3.0.3.2 with multi-stores from https://www.labeshops.com which has links to all my stores.

Image


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by labeshops » Sat Aug 01, 2020 11:03 pm

Okay, I figured out the fix. Thanks JNeuhoff for pointing me to it.

Edit file admin/view/javascript/summernote/summernote.js

Find around line 4342:

Code: Select all

      $.each(anchors, function (idx, anchor) {
        // if url doesn't match an URL schema, set http:// as default
        linkUrl = /^[A-Za-z][A-Za-z0-9+-.]*\:[\/\/]?/.test(linkUrl) ?
          linkUrl : 'http://' + linkUrl;

        $(anchor).attr('href', linkUrl);
        if (isNewWindow) {
          $(anchor).attr('target', '_blank');
        } else {
          $(anchor).removeAttr('target');
        }
      });

Replace with:

Code: Select all

      $.each(anchors, function(idx, anchor) {
    // if url doesn't match an URL schema, set http:// as default
    // only if onCreateLink callback not specified.

    if (options.onCreateLink) {
        linkUrl = options.onCreateLink(linkUrl);
    } else {
        linkUrl = /^[A-Za-z][A-Za-z0-9+-.]*\:[\/\/]?/.test(linkUrl) ?
            linkUrl : 'http://' + linkUrl;
    }

    $(anchor).attr('href', linkUrl);
    if (isNewWindow) {
        $(anchor).attr('target', '_blank');
    } else {
        $(anchor).removeAttr('target');
    }
});

Running Opencart v3.0.3.2 with multi-stores from https://www.labeshops.com which has links to all my stores.

Image


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by paulfeakins » Mon Aug 03, 2020 6:49 pm

labeshops wrote:
Sat Aug 01, 2020 11:03 pm
Okay, I figured out the fix.
Don't forget to add [SOLVED] to the beginning then.

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Guru Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom
Who is online

Users browsing this forum: No registered users and 25 guests