1. atrus
  2. RO CSVI
  3. Sunday, 28 June 2015
  4.  Subscribe via email
Hi Roland,

Noted the following issue when exporting VM3 product urls:

- When a product belongs to more than one categories, VM3 selects one of the links and sets it as canonical.

CSVI seems to export this canonical url, however it exports the url multiple times, and specifically as many times as the number of categories the product is in.

Example:

A product belongs to two categories and it has the following two urls depending on the category path the visitor used to find the product:

Url 1 http://www.quality-tuning.eu/cars/alfa-romeo/alfa-romeo-147/alfa-romeo-147-mk1-937/alfa-romeo-147-156-twin-spark-downpipe-detail

Url 2 http://www.quality-tuning.eu/cars/alfa-romeo/alfa-romeo-156/alfa-romeo-156-mk1-932/alfa-romeo-147-156-twin-spark-downpipe-detail

As you can see from the source code of each page, VM3 sets Url 1 as the canonical one (i don't know the selection criteria though) for this product.

In the attached exported file and log, you can see that Url 1 (the canonical one) is exported two times (because it belongs to two categories)

So it seems that there is a bug here, the two different urls should be exported.

Also i suggest the following export option: "Export only canonical URL", that would be also useful.

Would appreciate your feedback on this!

Rgrds,
Chris
Accepted Answer Pending Moderation
Hello Chris,

The way CSVI exports the URL is following this scheme:
  1. Check if the field product_url is filled, if so use this field.
  2. The product_url field is not filled then CSVI gets the first category ID returned by the database for this product. With this ID the regular URL is constructed. This is then turned into a SEF link if SEF is enabled.


So it seems that there is a bug here, the two different urls should be exported.
I don't consider this a bug because CSVI explicitly takes the first category ID returned by the database. Even then, if you export the same product multiple times CSVI won't know it exported URL X already for another product. You most likely won't have duplicate URLs if you set the Record Grouping to Yes in the template.

You talk about 2 different categories, what if a product is in 5 categories? Should there be 5 different URLs?

Rather than add an option for exporting the canonical URL, CSVI should always take the canonical URL because every page should only be reachable via 1 main link, all the other URLs are basically obsolete. This also solves the randomness of asking the database for the first category ID it finds.

Now how it is determined which is the canonical URL I will need to find out. :)
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 1
Accepted Answer Pending Moderation
Hi Roland,

Thanks for the useful info, becomes clearer now.

You talk about 2 different categories, what if a product is in 5 categories? Should there be 5 different URLs?


See attached an export file from a product in 21 categories B)

Record Grouping is set to YES, however i can see a single URL printed out multiple times, so some tuning here maybe is required. And ofcourse, determing the canonical is critical here, especial when exporting sitemaps for google etc. (even if they don't care if you export all urls of a products, provided that 1 of them will be the canonical)

Rgrds,
Chris
Attachments (2)
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
Hey Chris,

See attached an export file from a product in 21 categories
:silly:

Record Grouping is set to YES, however i can see a single URL printed out multiple times
That will happen because you are not exporting the distinctive field. In other words the category ID is different but not the URL. So it looks like 21 duplicate URLs. The URLs are not part of the query because they are created afterwards. If you would add the category ID to the list of export fields, you would see that the lines are not duplicates.

Not really anything I can do about it as it stands now because the first line has already been output when the second line is being processed, and so on. Ideally you would need to read the whole file and then filter the duplicates, that is then problematic again because of memory limitations with larger exports. One click with a spreadsheet program but lots of headaches on a hosting server....
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 3
Accepted Answer Pending Moderation
Thanks Roland,

In other words the category ID is different but not the URL.


Why the URLs are not different? Every category should have its own unique URL created and this is the case with Virtuemart, it creates on the fly different URLs for each category ID the product is in.

Maybe i'm missing smth :huh:

Rgrds,
Chris
  1. more than a month ago
  2. RO CSVI
  3. # 4
Accepted Answer Pending Moderation
Hey Chris,

You are missing this sentence I wrote earlier

CSVI gets the first category ID returned by the database for this product.
CSVI looks for a category ID based on the product SKU, this first one found is returned and URL is build based on that. The product SKU is the same every time, that is where the bottleneck is.

Does that clear things up?
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 5
Accepted Answer Pending Moderation
Thanks Roland,

It is indeed a pain, so we have asked VM team to make some modifications to the router in order to have only one URL per product (and categories)

So, i will revert soon!

Rgrds,
Chris
  1. more than a month ago
  2. RO CSVI
  3. # 6
Accepted Answer Pending Moderation
Hello Chris,

Let's see if they will make the change. Apart from that I could still look into always using the canonical URL instead of a random one.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 7
Accepted Answer Pending Moderation
Hi Roland,

We have already have changes in latest VM dev version, see attached latest rcvd by Max Milbers. This version actually creates 1 unique url per product using only the name of it. e.g. domain/productname

This is enabled by using hidden option seofull=0 at the vm config file and (saving the config to update the db)

Maybe we should wait for the official version which is about to be released, but from some tests i made seems that csvi is working ok on the export, but i get this error sometimes:

.
.
.
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/qttest/public_html/plugins/csvirules/replace/replace.php on line 137

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/qttest/public_html/plugins/csvirules/replace/replace.php on line 137

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/qttest/public_html/plugins/csvirules/replace/replace.php on line 137

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/qttest/public_html/plugins/csvirules/replace/replace.php on line 137

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/qttest/public_html/plugins/csvirules/replace/replace.php on line 137
{"process":false,"records":7338,"downloadurl":"","url":"http:\/\/http://www.quality-tuning.eu\/administrator\/index.php?option=com_csvi&view=logdetails&run_id=378"}

Rgrds,
Chris
  1. more than a month ago
  2. RO CSVI
  3. # 8
Accepted Answer Pending Moderation
Hello Chris,

see attached latest rcvd by Max Milbers.
I don't see anything attached?

The message you see isn't an error but a notice that the /e modifier will be removed in a later version of PHP, as of PHP 5.5 this has been marked deprecated so you see a notice when a regular expression replacement rule is used. Thanks for the heads up on this.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 9
Accepted Answer Pending Moderation
Hi Roland,

Sent by email due to size.

Rgrds,
Chris
  1. more than a month ago
  2. RO CSVI
  3. # 10
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!