Now the url of the product is changed based on the page you are.
For example:
If I click on category and then on product the url of the product will be:
www.mysite.com/sneakers/street/nike-air-max-v1
If I click on manufacturer and then on product the url of the product will be:
www.mysite.com/nike/nike-air-max-v1
For SEO reasons I want only a single url, the one when I click on category.
How can I do that in opencart 1.5x ?
I suggest using relationship canonical in head section of your website.
If you were to have these two URLs:
www.example.com/sneakers/street/nike-air-max-v1
www.example.com/nike/nike-air-max-v1
I would "choose" one main URL and then in each other URL section write this line
<link rel="canonical" href="http://www.example.com/nike/nike-air-max-v1">
So, at the end of the day, sneakers/street/nike-air-max-v1 page (part of) code would look like:
<head>
<title>Nike Air Max V1</title>
<link rel="canonical" href="http://www.example.com/nike/nike-air-max-v1">
</head>
Related
I have a WooCommerce store set up and I need to have it so that the store front shows the categories and then clicking through lists the products in that category. I have changed the store url to /soft-sell (it's a brand thing) and got it looping through the categories. The url for the click through page is /soft-sell/joe-b (for example), but the click through page is using the 'page-home.php' template and I can't find anything about why this is happening or how to change it. All I'm seeing on the category page is the home page. Anyone have any ideas?
Further info: I have declared woocommerce support in my functions
In case anyone finds this in the future, the solution is posted here
It's to do with the permalinks page having the incorrect custom structure, it needs to be /%product-category%/ not /%product_cat%/
I have some custom post types, which have their own .php file/template. In this I add some customizations to the title, so that it displays the $title+text.
What I need to accomplish now is two fold.
prepend and append some text to the actual <title> tag. So that it would look like <title>my text + original title + more text</title>
we have yoast seo plugin - we need this title to take precedence if someone goes in and inputs a specific title by hand. This should take precedence over the custom title for #1
Any help would be most appreciated.
I think this may be close to the solution:
Wordpress - different post title on frontend than in url
I could not seem to accomplish this with a filter. So I wrote some simple JS for the single-page.php template.
document.title="some text"+<%php $title %>+"other text";
Which makes the title tag:
<title>some text Original Title other text</title>
I'm using this line of code to display a button that will link to a specific product create by the author of a page:
<a class="button" a href="https://example.com/permalink-<?php the_author_meta('user_login'); ?>"> Take me there <?php the_author_meta('user_firstname')?></a>
Everything work fine, but I just need to adjust one think. The "permalink" text is in reality the product permalink the I set in wordpress admin page.
Now in my template I actually put that permalink without php code, and I think that the moment that I will decide to change product permalink to another value, it will take me to a 404 page.
How can I replace the actual permalink name with a php code that is able to find the right permalink no matter how and when I change it?
Thank you!
I have been thinking and searching about this
But i can't find the results..
Is it possible that if you click on a category "men" in a WP/ Woocommerce Shop that it will show a different logo then the main logo?
Like if you go to http://ninethemes.net/avano/wordpress/1/shop/#
And you will click a category like "men' that the Logo will change?
So yes, how can i do that the fastest way?
You can use jQuery or PHP. In jQuery detect a click on a category and then change the logo. For example by naming the logos the same as the category name.
In PHP you would need to edit header.php: detect which category you are on and replace the img with the one you want.
I would go for the PHP option.
I have a custom rewrite rule in my magento module.
Config.xml
<my_custom_url>
<from><![CDATA[#^/authors/author/([0-9])/([-\A-Za-z0-9.]+)/([0-9])/([-\A-Za-z0-9.]+)/?$#]]></from>
<to><![CDATA[/mymodule/author/books/author_id/$1/category_id/$3]]></to>
<complete>1</complete>
</my_custom_url>
Final Output
from : http://example.com/authors/author/12/john/3/fiction
to: http://example.com/mymodule/author/books/author_id/12/category_id/3/
It works fine but my problem is that in this page has list of books with pagination. If i click on the 2d page in the pagination link, then the URL change to its actual URL.
For example if i click on 2d page, then the URL is
http://example.com/mymodule/author/books/author_id/12/category_id/3/?p=2
I really need like this
http://example.com/authors/author/12/john/3/fiction/?p=2