News:

Support the VirtueMart project and become a member

Main Menu

Product short/long description Database column too short

Started by buzi, January 11, 2015, 11:24:48 AM

Previous topic - Next topic

buzi

Hi,
Thank you for the recent effort to launch VM version 3. im so happy to be using it.
im migrating an existing shop from a different system to VM 3.
the original products have long descriptions and  they dont fit in the products table columns: product_s_desc (VARCHAR (2000))  and product_desc (VARCHAR(18400))

i tried to change the datatype to TEXT but whenever i save the configuration from the administration panel it overwrites my changes and changes the datatype back to the original settings....

what do you suggest i do ?
Thanks Very much

AH

If it does not fit into product_desc

18400 varchar is pretty big!

You will have to Truncate if you want to use stock VM3



Regards
A

Joomla 4.4.5
php 8.1

buzi

Hi, thanks for your reply.
what if i can't truncate ? its has a lot of HTMl code in it, this is why its so big.
What is "stock VM3" ?
Anyway around the configuration changing back the table columns to the original Datatypes ? i know this is a hack but in my case i cant see a way around it...


AH

Create yourself another field in the dbase tables

Stick the data in there and reference that in the product detail displays

The dbase table addition is a core hack, but at least you will leave the core fields alone

Maybe someone else has a better suggestion
Regards
A

Joomla 4.4.5
php 8.1

buzi

its a good idea but h i wont be able to update those fields from the virtuemart administration products editor...
any other way to make the configuration saving process skip those columns somehow ?
Thanks

GJC Web Design

you need to dig into the save process - although wouldn't have thought that a simple save of the admin is checking table field types?
quick look I can't see it in the code

Do u mean this is on a save of a product or what do u mean?
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

buzi

Hi GJV,
try this:

1.change jos_virtuemart_products_en_gb.product_desc  to TEXT datatype
2.go to
administrator/index.php?option=com_virtuemart&view=config
3.click save, see what happens.

i get this notice:

Taking config from file

"alterTable CHANGE k3r0e_virtuemart_products_en_gb.product_desc : ALTER TABLE `k3r0e_virtuemart_products_en_gb` CHANGE COLUMN `product_desc` `product_desc` VARCHAR(18400) NOT NULL DEFAULT '' AFTER `product_s_desc`"

and this message:
"Table updated: Tablename k3r0e_virtuemart_products_en_gb dropped: 0 altered: 1 added: 0

Configuration Saved"

GJC Web Design

it comes from the function - seems to be called from the vmplugin.php

public function updateMyVmTables($file = 0, $like ='_virtuemart_'){

      if(empty($file)){
         $file = VMPATH_ADMIN.DS.'install'.DS.'install.sql';
      }

except that the lang tables aren't defined in VMPATH_ADMIN.DS.'install'.DS.'install.sql' and the lang section of that function in vm3.0.3 is commented out

poke around in that area maybe

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

buzi

great ! thanks for this
the functions that updates is here:
administrator\components\com_virtuemart\helpers\tableupdater.php
around line 324