[TYPO3-shop] Products in different home page zones
Juan Pablo Villaverde
jpablo at omnisciens.com
Tue May 6 06:20:09 CEST 2008
I will publish my solution just for the record, for other people with the
same needs until the TYPO3 template system is enhanced to support TSconfig
in tt_content records:
I edited flexforms_ds_pi1.xml and added:
<unique_product_id>
<TCEforms>
<label>LLL:EXT:tt_products/locallang_db.xml:tt_content.pi1_flexform.unique_product_id</label>
<config>
<type>input</type>
<size>25</size>
</config>
</TCEforms>
</unique_product_id>
after the template_suffix definition, at the end of the file.
Then added the label entry in locallang_db.xml for unique_product_id, like
the template_suffix entry
At this point you have an extra field in the plugin FlexForm. Use this form
to store the desired product ID.
In ttproducts_pi1.php around line 1000 you will find something like :
if ($this->conf['defaultProductID']) {
$this->tt_product_single['product'] = $this->conf['defaultProductID'];
} else if ($this->conf['defaultArticleID']) {
$this->tt_product_single['article'] = $this->conf['defaultArticleID'];
}
I changed it in order to use the new flex form field is exists:
// Read the flexform field
$unique_product_id =
$this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'unique_product_id');
if ($unique_product_id!="") {
// if this field is not empty then use it as default product
$this->tt_product_single['product'] = $unique_pruduct_id;
} else if ($this->conf['defaultProductID']) {
$this->tt_product_single['product'] = $this->conf['defaultProductID'];
} else if ($this->conf['defaultArticleID']) {
$this->tt_product_single['article'] = $this->conf['defaultArticleID'];
}
This solution works, but the correct solution should be to set this via TS.
Regards,
jp
"Juan Pablo Villaverde" <jpablo at omnisciens.com> escribió en el mensaje
news:mailman.1.1209999408.7348.typo3-project-tt-products at lists.netfielders.de...
> You are totally right, the defaultProductID is enough for my needs but the
> template system does not allow per content TSConfig, I will add the
> suggestion to the bugtracker.
>
> In the meantime in order to finish my site I will include the multiple
> Sigle Views via TS as different TS object paths with different
> defaultProductID. I think that this solution will work but I have another
> problem in this scenario, via standar content I can define a TEMPLATE
> SUFIX to apply different designs in each single view "box", but I cant
> find the TS property to indicate the template sufix with typoscript. But
> it is a different problem, I will create another post for this.
>
> regards,
>
> jp
>
> "Franz Holzinger" <franz at fholzinger.com> escribió en el mensaje
> news:mailman.1.1209972540.17297.typo3-project-tt-products at lists.netfielders.de...
>> Juan Pablo Villaverde a écrit :
>>>> Then you must use the product category and provide a category parameter
>>>> or a defaultCategoryID setup on the page.
>>>>> Or in the single view of a product you can use the defaultProductID.
>>>> Or there is some way to use the TYPO3 backend to select a special
>>>> product record for insert similar as for content element. But I did not
>>>> test this. Maybe some codings needs to be done here.
>>>>> - Franz
>>>
>>> The defaultProductID may be configured via TSConfig, and TSConfig is per
>>> page, and I need two or more different products, I need different
>>> defaultProductIDst for each single view content element in the page,
>>> then I
>>> can not use this option.
>>> Same case for defaultCategoryID.
>>>
>>> I think that the final challenge is to be able to set the
>>> defaultProductID
>>> in each Single View instance (in the content element instead of the
>>> page).
>>> The problem is that as far as I know is not possible to set a TSConfig
>>> for a
>>> content element, right? I think that the TSConfig is page wide in all
>>> cases
>>> :( And I can't figure out another way to achieve the needed behaviod..
>>
>> The TYPO3 template system must be enhanced to make this possible. A bad
>> way would be to add an additional product select to each plugin. This is
>> not usable or very much work for the shop admi if you have many products.
>>
>> - Franz
>
>
More information about the TYPO3-project-tt-products
mailing list