URL to a product

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
chricken
Posts: 29
Joined: 10 Nov 2017, 15:47

URL to a product

Post by chricken » 23 Feb 2018, 12:31

Hi,

for a business portal, where my products are listed, each product needs a URL to the detail-view.
I generate the data with the scheduler product export. Works fine, but unfortunately it does not export the URL.
Is it possible to get the URL with this export?

Alternatively, I thought, i could recompose the URL.
Unfortunately, I do not understand, how the URL is being composed.
Example:
https://www.insel-weine.de/shop/shop/de ... g_2016_D.O./
I have no clue, where the d/62 is coming from.

Alternatively it would be helpful to trigger the search engine. But again, I don't know, how.
Is there a possibility to interpret string parameters like:
https://www.insel-weine.de/shop/shop?search=galmes

I hope, someone can help me out with this problem.
Regards
Christian

User avatar
aimeos
Administrator
Posts: 7866
Joined: 01 Jan 1970, 00:00

Re: URL to a product

Post by aimeos » 23 Feb 2018, 23:20

You should be able to use the "$this->url()" view helper to create URLs to detail pages:
https://aimeos.org/docs/Developers/Html ... helper#url

You only need to configure the page ID of the product detail page in the "Aimeos shop advanced scheduler" used for the product export.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

chricken
Posts: 29
Joined: 10 Nov 2017, 15:47

Re: URL to a product

Post by chricken » 05 Mar 2018, 12:11

Hi,
thank you for your answer,
but I honestly have no idea, what I have to do :(

I changed the pageID in the scheduler with no effect.
Do I have to do any changes in the typoscript-configuration?

Regards
Christian

User avatar
aimeos
Administrator
Posts: 7866
Joined: 01 Jan 1970, 00:00

Re: URL to a product

Post by aimeos » 06 Mar 2018, 23:08

You need to add that code to https://github.com/aimeos/ai-controller ... andard.xml:

Code: Select all

$detailTarget = $this->config( 'client/html/catalog/detail/url/target' );
$detailCntl = $this->config( 'client/html/catalog/detail/url/controller', 'catalog' );
$detailAction = $this->config( 'client/html/catalog/detail/url/action', 'detail' );
$detailConfig = $this->config( 'client/html/catalog/detail/url/config', [] );

$params = array( 'd_name' => $item->getName( 'url' ), 'd_prodid' => $id );
$url = $this->url( $detailTarget, $detailCntl, $detailAction, $params, [], $detailConfig );
This code is from the sitemap template: https://github.com/aimeos/ai-controller ... andard.xml
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

chricken
Posts: 29
Joined: 10 Nov 2017, 15:47

Re: URL to a product

Post by chricken » 15 Mar 2018, 08:16

Sorry for the the delay, had some other issues.

Got it working finally. It wasn't as easy as it looks at first glance.
I had to add a new XML-node, looking like this:

Code: Select all

<detailURL><![CDATA[<?php
$params = array( 'd_name' => $item->getName( 'url' ), 'd_prodid' => $id );
$url = $this->url( $detailTarget, $detailCntl, $detailAction, $params, [], $detailConfig );
echo $url;?>]]></detailURL>


Now I can go on, thank you :)

Post Reply