View Issue Details

IDProjectCategoryView StatusLast Update
0002534OXID eShop (all versions)1.01. Products (product, categories, manufacturer, promotions etc.)public2012-12-07 14:29
Reporterwebtools 
PriorityhighSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version4.5.0_beta3 
Summary0002534: parseThroughSmarty doesn`t work proper
Description1) parseThroughSmarty doesn't work with categories and articles
This error could be within other calls, too.

"Artikelbeschreibung und Kategorienbeschreibung mit Smarty ausführen" is checked.

Filling oxartextends->oxlongdesc or oxcategories->oxlongdes with Variables doesn`t work. Nothing happens. The Values aren`t replaced.

To reproduce it, is really simple: Use some Variables within the oxlongdesc.
Nothing happens at the front-end. The variables are ignored!

2) startProfile("parseThroughSmarty"); is started 2 Times.
a) within function parseThroughSmarty every time
b) at the assign-method of oxcategory.php
Is this right?
TagsProducts
Theme
BrowserAll
PHP Versionany
Database Versionany

Activities

dainius.bigelis

2011-02-18 14:44

reporter   ~0004136

Reminder sent to: webtools

Hi,

Could you please tell the eShop version, where you found this issue?

Best regards,

webtools

2011-02-18 16:34

reporter   ~0004138

Last edited: 2011-02-18 19:09

View 2 revisions

Hi,

I checked with PE4.4.5 and CE 4.4.6

I don`t think that it is dependent from the Shop-Versions.

Only take on oder 2 Variables, put them via Admin in one longdesc-field an check whether you see the data of the varibale within the front-end.

arvydas_vapsva

2011-03-08 12:39

reporter   ~0004195

Reminder sent to: webtools

Did you try to reproduce on demoshop? Cant reproduce, everything works for me. Can you paste what smarty code you want to embed/execute?

webtools

2011-03-08 13:12

reporter   ~0004196

Last edited: 2011-03-08 13:13

View 2 revisions

???

Use for example [{ $product->oxarticles__oxtitle->value}] as variable and put it into the longdesc-field of any article.

Nothing happens.

arvydas_vapsva

2011-03-08 15:19

reporter   ~0004198

Ah, yes. This problem is known and can't be simply fixed. I could not reproduce it, because i used more general variable "$oViewConf" for testing.

There is two ways to fix the problem you mention:

    1. use view product getter if possible e.g. details:

        [{assign var="_product" value=$oView->getProduct() }]
        [{ $_product->oxarticles__oxtitle->value}]

    2. use [{eval}] directly in template.

We are working on more general solution

arvydas_vapsva

2011-03-15 09:49

reporter   ~0004226

Changes:
 - introduced [{oxeval var=(accepts oxField/string)}] smarty function, which should be called in templates to process long descriptions containing smarty tags;
 - long description fields are not automaticaly processed by smarty, thus saving from non admin does not break original content;
 - introduced new getters which returns smarty processed long description data:
    oxNews::getLongDesc();
    oxArticle::getLongDesc();
    oxCategory::getLongDesc();

webtools

2011-03-16 15:06

reporter   ~0004230

could please show me 1 complete-working example for the version before 4.5?

Thanks!

arvydas_vapsva

2011-03-16 15:40

reporter   ~0004231

Reminder sent to: webtools

1. switch off "Artikelbeschreibung und Kategorienbeschreibung mit Smarty ausführen" is checked.
2. Edit templates and change affected areas with [{eval var=$product->oxarticles__oxtitle->value}].

webtools

2011-03-16 16:02

reporter   ~0004232

???

Switching on or off? I think you mean ON?

I don`t want to edit a template. I only want to put for example [{eval var=$product->oxarticles__oxtitle->value}] within the longdesc as admin.

Perhaps you undestand it better like this. I wan`t to write a module which works with text-blocks which can be saved within the cms of the shop.

So with the help of an extra field, I want to declare which text-block is used AS product-description. Within the text-block I want to use e.g. [{eval var=$product->oxarticles__oxtitle->value}]

But the Step before using variables within the oxlongdesc doesn`t work.

arvydas_vapsva

2011-03-16 16:25

reporter   ~0004233

Last edited: 2011-03-16 16:27

View 2 revisions

Reminder sent to: webtools

sorry, just copy pasted your text.

Generally in oxid < 4.5.0 parsing of smarty tags must be switched OFF and actions must be applied from templates side to solve problem you mention.

Will try to explain the reason why [{ $product->oxarticles__oxtitle->value}] value is not available in your case.

Parsing of long description is done immediatelly after product is loaded, means that special utility class loads smarty object, passes current view/view config objects to it, assigns long description and calls smarty function which generates content as SEPARATE template (where "product" parameter is not available, like it would be in the middle of standard details template).

So in version 4.5 we simply removed this autoprocessing of long descriptions and moved it to templates, where all needed parameters is available. Thus saving additional resources.


In your very custom case you can workaround the problem by:

- writing module for details or other view, where this long description is loaded and implement product getter;
- edit product long description and assign missing variable [{assign var="product" value=$oView->getCustomeProduct('product_id') }]