News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Product description in the shopping cart?

Started by Piombo, March 20, 2015, 14:11:23 PM

Previous topic - Next topic

Piombo

Hello!
How to show product description in the shopping cart table?

I showed stock: $prow->product_in_stock, i showed sku: $prow->product_sku.  But product description does`t work: $prow->product_desc

Also, i can't show manufacturer name: $prow->mf_name

Thks!

Studio 42

try a var_dump($prow); to see what you can use.
If you need more then you have to overide it with your own function. But in my case i have all fields

object(stdClass)[301]
  public 'virtuemart_manufacturer_id' =>
    array (size=1)
      0 => string '3' (length=1)
  public 'mf_name' => string 'Producer' (length=8)
  public 'slug' => string 'jumper' (length=6)
  public 'mf_email' => string 'info@producer.com' (length=17)
  public 'mf_desc' => string '<p>An example for another manufacturer.</p>' (length=43)
  public 'virtuemart_manufacturercategories_id' => string '1' (length=1)
  public 'mf_url' => string 'producer.com' (length=12)
  public 'published' => string '1' (length=1)
  public 'virtuemart_product_id' => string '69' (length=2)
  public 'virtuemart_vendor_id' => string '1' (length=1)
  public 'product_parent_id' => string '68' (length=2)
  public 'product_sku' => string 'ZUI' (length=3)
  public 'product_gtin' => null
  public 'product_mpn' => null
  public 'product_name' => string 'Jumper' (length=6)
  public 'product_s_desc' => string 'Pattern for Clothing. For showcase reason this pattern is NOT unpublished.' (length=74)
  public 'product_desc' => string '<p>For showcase reason this pattern is NOT unpublished.</p>' (length=59)
........


Piombo

Hello! (Joomla! 2.5.24,  VirtueMart 2.6.10)

I've done
<?php var_dump($prow); ?>
in cart/default_pricelist.php, I saw a lot of fields in my case but there is no fields 'mf_name & product_desc.


object(stdClass)#203 (50) {
["virtuemart_manufacturer_id"]=> string(2) "23"
["slug"]=> string(27) "zerkalo-rondo-v-reznoj-rame"
["published"]=> string(1) "1"
["virtuemart_product_price_id"]=> string(3) "673"
["virtuemart_product_id"]=> string(4) "1675"
["virtuemart_shoppergroup_id"]=> NULL
["product_price"]=> string(9) "697.00000"
["override"]=> string(1) "0"
["product_override_price"]=> string(7) "0.00000"
["product_tax_id"]=> string(1) "0"
["product_discount_id"]=> string(1) "0"
["product_currency"]=> string(2) "47"
["virtuemart_vendor_id"]=> string(1) "1"
["product_parent_id"]=> string(1) "0"
["product_sku"]=> string(4) "7082"
["product_name"]=> string(45) "Зеркало Rondo в резной раме"
["product_s_desc"]=> string(4) "1161"
["product_weight"]=> NULL
["product_weight_uom"]=> string(2) "KG"
["product_length"]=> NULL
["product_width"]=> NULL
["product_height"]=> NULL
["product_lwh_uom"]=> string(1) "M"
["product_in_stock"]=> string(1) "1"
["product_ordered"]=> string(1) "0"
["product_available_date"]=> string(19) "0000-00-00 00:00:00"
["product_availability"]=> string(7) "24h.gif"
["product_sales"]=> string(1) "0"
["product_unit"]=> string(2) "KG"
["product_packaging"]=> NULL
["min_order_level"]=> NULL
["max_order_level"]=> NULL
["virtuemart_media_id"]=> array(2) {[0]=> string(4) "2483" [1]=> string(4) "2491" }
["step_order_level"]=> NULL
["image"]=> object(VmImage)#244 (41) {
["media_attributes"]=> int(0)
["setRole"]=> bool(false)
["file_name"]=> string(35) "Grilli_-_Rondo_mirror_art.180501_01"
["file_extension"]=> string(3) "jpg"
["virtuemart_media_id"]=> string(4) "2483"
["_foldersToTest":"VmMediaHandler":private]=> array(2) {
[0]=> string(64) "/data/www/data/mebel-rim-shop/images/stories/virtuemart/product/"
[1]=> string(72) "/data/www/data/mebel-rim-shop/images/stories/virtuemart/product/resized/" }
["_actions":"VmMediaHandler":private]=> array(0) { }
["_mLocation":"VmMediaHandler":private]=> array(0) { }
["_hidden":"VmMediaHandler":private]=> array(0) { }
["theme_url"]=> string(46) "http://mebel-rim.ru/components/com_virtuemart/"
["virtuemart_vendor_id"]=> string(1) "1"
["file_title"]=> string(39) "Grilli_-_Rondo_mirror_art.180501_01.jpg"
["file_description"]=> string(39) "Grilli_-_Rondo_mirror_art.180501_01.jpg"
["file_meta"]=> string(39) "Grilli_-_Rondo_mirror_art.180501_01.jpg"
["file_mimetype"]=> string(10) "image/jpeg"
["file_type"]=> string(7) "product"
["file_url"]=> string(73) "images/stories/virtuemart/product/Grilli_-_Rondo_mirror_art.180501_01.jpg"
["file_url_thumb"]=> string(86) "images/stories/virtuemart/product/resized/Grilli_-_Rondo_mirror_art.180501_01_x149.jpg"
["published"]=> string(1) "1"
["file_is_downloadable"]=> string(1) "0"
["file_is_forSale"]=> string(1) "0"
["file_is_product_image"]=> string(1) "0"
["shared"]=> string(1) "0"
["file_params"]=> string(0) ""
["file_lang"]=> string(0) ""
["_xParams"]=> int(0)
["_varsToPushParam"]=> array(0) { }
["_translatable"]=> bool(false)
["_cryptedFields"]=> bool(false)
["_tablePreFix"]=> string(0) ""
["created_on"]=> string(19) "0000-00-00 00:00:00"
["created_by"]=> string(1) "0"
["modified_on"]=> string(19) "2015-02-26 13:39:27"
["modified_by"]=> string(3) "436"
["locked_on"]=> string(19) "0000-00-00 00:00:00"
["locked_by"]=> string(1) "0"
["file_url_folder"]=> string(34) "images/stories/virtuemart/product/"
["file_path_folder"]=> string(34) "images/stories/virtuemart/product/"
["file_url_folder_thumb"]=> string(42) "images/stories/virtuemart/product/resized/"
["media_role"]=> string(19) "file_is_displayable"
["file_name_thumb"]=> string(40) "Grilli_-_Rondo_mirror_art.180501_01_x149" }
["categories"]=> array(1) { [0]=> string(3) "100" }
["virtuemart_category_id"]=> string(3) "100"
["category_name"]=> string(10) "Общая"
["link"]=> string(50) "/index.php/shop/zerkalo-rondo-v-reznoj-rame-detail"
["packaging"]=> string(0) "" [
"quantity"]=> int(1)
["product_price_publish_up"]=> string(19) "0000-00-00 00:00:00"
["product_price_publish_down"]=> string(19) "0000-00-00 00:00:00"
["price_quantity_start"]=> string(1) "0"
["price_quantity_end"]=> string(1) "0"
["prices"]=> array(18) {
["costPrice"]=> string(9) "697.00000"
["basePrice"]=> float(46343.08510638)
["basePriceVariant"]=> float(46343.08510638)
["basePriceWithTax"]=> float(0)
["discountedPriceWithoutTax"]=> float(46343.08510638)
["priceBeforeTax"]=> float(46343.08510638)
["salesPrice"]=> float(46343.08510638)
["taxAmount"]=> float(0)
["salesPriceWithDiscount"]=> float(0)
["salesPriceTemp"]=> float(46343.08510638)
["unitPrice"]=> float(0)
["discountAmount"]=> float(-0)
["priceWithoutTax"]=> float(46343.08510638)
["variantModification"]=> float(0)
["DBTax"]=> array(0) { }
["Tax"]=> array(0) { }
["VatTax"]=> array(0) { }
["DATax"]=> array(0) { } }
["url"]=> string(50) "/index.php/shop/zerkalo-rondo-v-reznoj-rame-detail"
["customfields"]=> string(0) ""
["cart_item_id"]=> int(1675)
["amount"]=> int(1) }

GJC Web Design

well - you should be on 2.6.17 - maybe these fields are included

if not do a local query in the loop for the desc etc
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

Piombo

Thanks, it's clear! Unfortunately I can`t upgrade. Could you give an example of a query, and where to do that (in default_pricelist.php ?)

GJC Web Design

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

Piombo

Hello!

I tried to use your advice, I rewrote the code:



   function getManufacturerName($virtuemart_manufacturer_id) {
   $db = JFactory::getDBO();
   $q = 'SELECT mf_name FROM `#__virtuemart_manufacturers_ru_ru` '
      . 'WHERE `virtuemart_manufacturer_id` = ' . $virtuemart_manufacturer_id;     
   $db->setQuery($q);
   $country_code = $db->loadResult();
       return $mf_name;
      }
   $mf_name = getManufacturerName($this->orderDetails['details']['BT']->virtuemart_manufacturer_id);

//   echo $mf_name;

   var_dump($mf_name);



But, "var_dump" says that - $mf_name = NULL :(

Here is a screenshot of my tables in the database: http://pasteboard.co/2ghoeFdK.png

What did I do wrong?

Studio 42

Hi,
$this->orderDetails['details']['BT']->virtuemart_manufacturer_id
BT is the bill to adress, You must get the value from the list of products Loop in cart

Piombo

How to do that? Which file I can to see an example?