Oxidshop - Get a product url - oxid

I am working on Oxidshop tpl files and want to know how can I get a url for a particular product so that I can create an anchor tag linking to the product in a tpl file?

there are basically two options:
[{$product->getMainLink()}]
[{$product->getLink()}]
The first one gives you the general main link to the product in its main category http://your-shop.tld/category/article.html
The second one should give you the link according to the context, e.g. if you are browsing the articles from a particular manufacturer, you should get http://your-shop.tld/manufacturer/article.html

Related

Kademi - how to set canonicals on a product page

I am trying to set a canonical on a product detail page to prevent duplicate pages of the same URL.
Our client's website has 1375 however search engines are picking up 2890 because the overwhelming majority of pages are being rendered as duplicate such as the below several examples.
Same product example 1:
https://www.waterware.co.nz/store/1-function-hand-shower
https://www.waterware.co.nz/store/FW556
Same product example 2:
https://www.waterware.co.nz/store/1-function-hand-shower-black
https://www.waterware.co.nz/store/FW550BL
Same product example 3:
https://www.waterware.co.nz/store/1-2m-shower-hose-metal-wound
https://www.waterware.co.nz/store/FH112SS
And repeat 1375x.
I have since discovered where the 2nd version of the URL is coming from - its the favourites icon on product detail page - and will begin removing / adjusting these.
However in order to maintain best SEO practices I need to find a way to set a canonical.
I am aware that this could be done MasterTemplate.html. However there does not seem to be a way to discover the correct scope when in the master template file.
Any suggestions?
Thanks
SEO integration was commented out in KCommerce2, but it will be re-enabled in the next release later this week
This uses the webname property in the canonical href.
It also inserts the meta description field using the brief if its available, otherwise the product body.
And it also generates a meta keywords tag, using the product code, categories and brand.
To use this once available, you will just need to update to KCommerce 3.1.3 or later.

Output a Static Block on the Product Description

I wish to add a Static Block(s) to Magento's product description field in the same way it could be added to a regular page. Example: http://www.screencast.com/t/l5DbjRZagVKv
If I add the code: {{block type="cms/block" block_id="your_block_id"}} to the page description of a product it will just output as text. Example: http://www.screencast.com/t/pUS4CObZ
It is important that I am able to manage static blocks for a range of similar products, for example Electral goods have different Warranty information than Bathroom products. The information will be the same across 100s of products but not all of them.
If there is a solution/workaround that someone could suggest then it would be greatly appreciated. I've been googling all day and their seems to be nothing.
Many thanks in advance!
I may not be sure what you want to achieve but according to my understanding i think you want to show the static block to some limited number of products.Is it right?If so than you can create a new category and assign those products to that category.
Now all you need to do is go to your "app/design/frontend/base/default/template/catalog/product/view.phtml".
Here you need to check the condition that if the product is of the particular category you defined than you output that block.
To output the static block in the template file you can do following.
echo $this->getLayout()->createBlock('cms/block')->setBlockId('my-new-block')->toHtml();
Hope you understood what i am trying to say and hope it will help.

Drupal 7: Combining multiple content type in single view

I have a content type called Author which is referred in another two content types called Novel and Book via Node Reference Module.So we can add author entity to both Book and Novel content types.
Both Novel and Book contain another field called Release Date.
Now I want to show a block which will display the name of book and name of novel in chronological order based upon the release date when user come to that corresponding Author Page.
Ex. Suppose A is an author who is author of BookA(Release Yr-2006), NovelB(Release Yr-2004),BookC(Release Year-2009). When user come to Author A page then he will be shown a block which will show the Books/Albums in chronological order like this:-
NovelB--BookA--BookC
Please suggest as how to achieve in Drupal 7.
You want to display the following field title (I assume the book name is the node title)
For the sorting you can use the sort option in views, it is pretty self-explaining. Choose the name of your release date field.
For the connection between author and books you will have to use a contextual filter (advanced).
Add the author-reference-field from your book/novel (the field you use to refer to the author). Then choose to use a default value (2nd option) and choose content id from url. Now your block will find all nodes that refer to the page with the current page-id. Since we chose to display the title fields, you should see a list.
Note that live preview does not work here, so you will have to go to the actual page to see the result.
UPDATE:
This works when you have re-used the same field for both content types. If you have uses more then one field you will have to use an OR operator to make the contextual filter work. Thanks to d34dman the following page was given to do just that.
Although for new implementations I would recommend using the same field (eg. reference_to_author) for all references from all content types.
Yah..I am able to solve this problem by adding custom code. I have used hook_views_query_alter method and then added join relationship and where clause as per requirement. Please refer to following article for more clarity..
http://www.midwesternmac.com/blogs/jeff-geerling/filtersearch-multiple-fields
Thanks for posting the reply and keeping my hope alive.

Parsing Jekyll's Categories

I have created a simple blog based on the Jekyll engine but I need one more function to make the thing really complete.
In Jekyll, parent directories of posts are implicitly 'labels' or 'categories'. So, if I were to create a post under the directory structure
/computers/scm/git
it would end up having 3 labels (computers, scm, git)
In my blog, I have created a few pages:
/computers/index.html
/computers/scm/index.html
/computers/scm/git/index.html
and these pages explicitly list posts in their respective categories such that /computers/index.html displays links to every post in /computers, /computers/sc and /computers/scm/git ... and likewise on down the road. Unfortunately, categories are not compound in Jekyll and so, "/computers/scm/index.html" iterates over the same set of posts as "/sandwiches/scm/index.html" …
Now, I'd like to automatically generate a sitemap listing all the categories, providing links to all of the pages I've created. Jekyll includes a construct "site.categories" that I can iterate over which works just great for all the top level categories. The problem is that when "scm" comes up, there is no "/scm/index.html" - it needs to be "/computers/scm/index.html".
I'm not sure I can fix this behavior - what type of extensions can I write to get both hierarchical categories and automatically generate a site map to my listing pages?
In my wildest dreams, I'd like to be able to tag a post as /a/b/c and have it associated with labels /a, /a/b and /a/b/c and then be able to generate pages that iterate over exactly these sets of posts. I need the site's organization to drill down from general to specific.
Do I need to try a different static generation engine?
You need to use Jekyll's plugins. For categories support in my blog I use one of this.
If you are Github Pages user, you must note that GP does not support plugins because of security reasons. To avoid this, you may use ideas from this blog post.
As an alternative, you can use Octopress, which is Jekyll-based.

How to prevent ordering certain products - or a category - from a specific country

I have a category dedicated for exported goods , obviously , they will not be sold locally . so , how can I prevent customers who are from my country from ordering products that are meant only for exporting.. and showing an error message .. please help !
I would say that you will have to create a new product type. You'll need a new module (use Daniel's excellent kick-start extension: http://www.magentocommerce.com/magento-connect/Daniel+Nitz/extension/1108/modulecreator) and then have your model extend Mage_Catalog_Model_Product_Type_Simple.
Then, add a new attribute for your new product type to capture Allowed Countries, and implement the isSalable method in your Model to check for Allowed Countries.
This is not trivial, but it should be the right approach. The guys at Inchoo (who write a great blog) have a good tutorial on the process: link text and in fact they've provided the shell of the module.
Good luck!
JD

Resources