Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Where is the CMS Form tab getting the price from? View modes: 
User avatar
Member
Member
Dlglsh - 6/14/2012 6:54:12 AM
   
Where is the CMS Form tab getting the price from?
Hi,

I have a product in the COM_SKU table which has a price of £12.50, which I updated in the SQL database directly (I set all prices to £12.50). I have also set the price to £12.50 in my custom table, TableA. When I select the Form tab of the document, the Price value is still showing the previous price (£15), yet the Product tab shows the new price of £12.50. If I add the product to my basket, it is added as £12.50.

I have run a query on both tables to select distinct prices and the only value returned is £12.50.

So what is vexing me is where the document Form tab Price field value of £15 is coming from?

Has anyone come across this before and/or know how to fix it? Does Kentico store the data in another table other the SKU_COM table?

Thanks,

Matt

User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 6/14/2012 9:16:44 AM
   
RE:Where is the CMS Form tab getting the price from?
Do you have a workflow for that document? Can you look at the versions to see if you might be seeing one in the form tab that has not been published?

User avatar
Member
Member
Dlglsh - 6/14/2012 10:45:24 AM
   
RE:Where is the CMS Form tab getting the price from?
Hi,

Thanks for the reply.

The workflow is showing as Published, though it was published before I ran the query on the DB to change the price to £12.50.

Matt

User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 6/14/2012 4:33:00 PM
   
RE:Where is the CMS Form tab getting the price from?
Was there a previous version with 15 in it?

User avatar
Kentico Support
Kentico Support
kentico_janh - 6/15/2012 2:22:35 AM
   
RE:Where is the CMS Form tab getting the price from?
Hello,

The issue is, that you can see the price under the Form tab -> under this tab are displayed only document fields, so that is the reason why the price was not changed, when you updated it for a product. If you switch to the Product tab of your document, you should see that updated price. Anyway each document type has its own table in the database so you can find that price field there (in the document code name table).

Best regards,
Jan Hermann

User avatar
Member
Member
Dlglsh - 6/15/2012 3:55:44 AM
   
RE:Where is the CMS Form tab getting the price from?
Hi,

Thank you for the reply.

I'm a little confused about the last part of your post. The table name value under Document types > Document type name > General > [Table name] is for example TableA. In the KenticoCMS database I have a table called TableA.

Is this the table you are referring to? If so, all the prices in this table were also set to £12.50. I've run a SELECT DISTINCT query against it and that is the only price in the table.

@ Jiveabillion - In the Versions tab there is one version that was never published and one that is the current published version. The current version has £15 in it - but this information is being drawn from the document table above, which is now £12.50.

Thanks,

Matt

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 6/16/2012 10:33:50 AM
   
RE:Where is the CMS Form tab getting the price from?
Hi,

You need to realize that there is a document (node) object and a SKU object. They are separate. However, when you want to use the e-commerce, you need to connect these two objects.
You can also set the CMS in the way that whenever you create an instance of document type X, at the same type a SKU X is also created. But you can have also a separate SKU and then bind it to some document (via the Product tab in CMS Desk -> Content).

In this case I would recommend to check the field mappings between the document type fields and product fields so they are updated automatically when you change the value for the document field (it does not work vice vers): fields mappings

I hope it makes more sense now. Let me know if you have any further questions.

Best regards,
Juraj Ondrus

User avatar
Member
Member
Dlglsh - 6/18/2012 2:58:45 AM
   
RE:Where is the CMS Form tab getting the price from?
Hi Juraj,

The document and SKU are mapped (the product title and price). If I change the price in the document Form tab, it will update the price in the Product tab as well (as expected). However, I updated the price in the SKU table and the document table directly using an SQL query but the document Form tab still says £15, not £12.50. This is what is confusing me.

Thanks,

Matt

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 6/18/2012 1:10:01 PM
   
RE:Where is the CMS Form tab getting the price from?
Hi,

If you do it directly in the DB, the code which is updating the SKU price after the document field was edited is not fired.

Best regards,
Juraj Ondrus

User avatar
Member
Member
Dlglsh - 6/19/2012 2:38:56 AM
   
RE:Where is the CMS Form tab getting the price from?
Hi Juraj,

I appreciate this, but I have updated the price in both tables (COM_SKU and custom table) in the database.

So in short, there were products with varying prices and then in both tables I set every price to £12.50, but when viewing the Form tab for particular products, the custom price field displays the price from before I set all the prices to £12.50.

So what is confusing me is where the Form tab is reading the £15 value from, if every price in the custom table and COM_SKU table is set to £12.50.

When I create a new document it creates an entry in the custom table and an entry in the COM_SKU table. Does Kenitco record the information anywhere else?

Thanks,

Matt

PS. I have screenshots if you would like me to email them to you?

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 6/19/2012 10:50:41 AM
   
RE:Where is the CMS Form tab getting the price from?
Hi,

Yes, you can send us the screenshots to support at kentico.com, however we believe that you've really updated the values in the DB.

One problem might be that the value was not updated from the DB to the application memory (hashtables). You could try to restart the application to see whether it helps.
(If yes, you could then clear the hashtables after every direct DB update)

Another problem might be if you were using workflows. Could you please specify if you use workflow for the Product documents or not?

Thank you in advance for information.

Regards,
Zdenek

User avatar
Member
Member
Dlglsh - 6/20/2012 2:38:30 AM
   
RE:Where is the CMS Form tab getting the price from?
Hi Zdenek,

Thanks for your reply.

The application has since been restarted a few times but hasn't affected the value.

Workflows were previously not being used, but they were 'turned on' on 7th June and I updated the prices in the database on 13th June. The Product documents are currently using our workflow.

Thanks,

Matt

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 6/27/2012 9:14:47 AM
   
RE:Where is the CMS Form tab getting the price from?
Hi,

As we've discussed and found the cause over the email, I'm just adding quick summary here.
The reason was in the Workflow applied to the product documents. Then, using your API code, you've updated only the published version, not the last one that's shown in the CMS Desk in Edit mode.
API usage for updating the last version can be found in this DevGuide article

Regards,
Zdenek,