Author Topic: Category Page Fields for Templating  (Read 136152 times)

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10275
  • VirtueMart Version: 3+
Re: Category Page Fields for Templating
« Reply #15 on: March 12, 2012, 10:25:33 am »
I want to link an image to a URL on the internet (e.g. a specific youtube video)

You are going to have to save the url in one of the "other fields", and use that variable in the url creation.

I do NOT do development work for hire.

corymp

  • Jr. Member
  • **
  • Posts: 149
Re: Category Page Fields for Templating
« Reply #16 on: March 19, 2012, 18:23:19 pm »
How can I display a product's custom field on the category page. So far I have:

Code: [Select]
<?php
if (!empty($product->customfieldsSorted['myposition'])) { 
       foreach (
$product->customfieldsSorted['myposition'] as $field) {
if ($field->display) {
if ($field->custom_title != $custom_title) { 
echo $field->display;
}

?>
VM 2.0.4 Stable
J2.5.4

corymp

  • Jr. Member
  • **
  • Posts: 149
Re: Category Page Fields for Templating
« Reply #17 on: March 20, 2012, 18:01:06 pm »
No response on this? it's not possible?
VM 2.0.4 Stable
J2.5.4

hollywooood

  • Jr. Member
  • **
  • Posts: 51
  • If everything was easy it woud be frickin awesome!
Re: Category Page Fields for Templating
« Reply #18 on: March 21, 2012, 08:11:02 am »
Essentially, I have my category, productdetails and categories folders in the com_virtuemart, html folder.  The product details page works, the categories page works but the category page is non functional.  I have read and re-read this post 5 or 6 times, copied and pasted the coding (which is still the same as what I have) but all this has been done in vain. 

This all started when i made the migration from VM2.0 to VM2.0.2...  My head is really spinning here and all the numbers and letters are starting to merge together and NO, I am not on drugs.

Here is my product coding from the category page:
Code: [Select]
// Show Products ?>
<div class="product floatleft<?php echo $Browsecellwidth $show_vertical_separator ?>">
<div class="spacer">
<div class="floatleft center width140">
               
<?php /** @todo make image popup */
echo $product->images[0]->displayMediaThumb('class="browseProductImage" border="0" title="'.$product->product_name.'" ',true,'class="modal"');
?>



<!-- The "Average Customer Rating" Part -->
<?php if (VmConfig::get('pshop_allow_reviews') == 1) { ?>
<span class="contentpagetitle"><?php echo JText::_('COM_VIRTUEMART_CUSTOMER_RATING'?>:</span>
<br />
<?php
// $img_url = JURI::root().VmConfig::get('assets_general_path').'/reviews/'.$product->votes->rating.'.gif';
// echo JHTML::image($img_url, $product->votes->rating.' '.JText::_('COM_VIRTUEMART_REVIEW_STARS'));
// echo JText::_('COM_VIRTUEMART_TOTAL_VOTES').": ". $product->votes->allvotes; ?>

<?php ?>
<div id="productname-box">
                    <br/>
<h2><?php echo JHTML::link($product->link$product->product_name); ?></h2>

<?php // Product Short Description
if(!empty($product->product_s_desc)) { ?>

<p class="product_s_desc">
<?php echo shopFunctionsF::limitStringByWord($product->product_s_desc40'...'?>
</p>
<?php ?>

<div class="product-price marginbottom12" id="productPrice<?php echo $product->virtuemart_product_id ?>">
<?php
if ($this->show_prices == '1') {
if( $product->product_unit && VmConfig::get('vm_price_show_packaging_pricelabel')) {
echo "<strong>"JText::_('COM_VIRTUEMART_CART_PRICE_PER_UNIT').' ('.$product->product_unit."):</strong>";
}

//todo add config settings
if( $this->showBasePrice){
echo $this->currency->createPriceDiv('basePrice','COM_VIRTUEMART_PRODUCT_BASEPRICE',$product->prices);
echo $this->currency->createPriceDiv('basePriceVariant','COM_VIRTUEMART_PRODUCT_BASEPRICE_VARIANT',$product->prices);
}
echo $this->currency->createPriceDiv('variantModification','COM_VIRTUEMART_PRODUCT_VARIANT_MOD',$product->prices);
echo $this->currency->createPriceDiv('basePriceWithTax','COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX',$product->prices);
echo $this->currency->createPriceDiv('discountedPriceWithoutTax','COM_VIRTUEMART_PRODUCT_DISCOUNTED_PRICE',$product->prices);
echo $this->currency->createPriceDiv('salesPriceWithDiscount','COM_VIRTUEMART_PRODUCT_SALESPRICE_WITH_DISCOUNT',$product->prices);
echo $this->currency->createPriceDiv('salesPrice','COM_VIRTUEMART_PRODUCT_SALESPRICE',$product->prices);
echo $this->currency->createPriceDiv('priceWithoutTax','COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX',$product->prices);
echo $this->currency->createPriceDiv('discountAmount','COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT',$product->prices);
echo $this->currency->createPriceDiv('taxAmount','COM_VIRTUEMART_PRODUCT_TAX_AMOUNT',$product->prices);
?>

</div>
                    <br/>
<p class="prodetails-button">
<?php // Product Details Button
echo JHTML::link($product->linkJText::_('COM_VIRTUEMART_PRODUCT_DETAILS'), array('title' => $product->product_name,'class' => 'product-details'));
?>

</p>

</div>

The proper number of products is being shown on the page but no images or product names and the links are not going anywhere. 

I really really really appreciate any insight on this.  Also please note that I have search everywhere for this but as I said I am a bit head spun.
Joomla 2.5.4
Virtuemart 2.0.6
PHP 5.2.17
MySQL 5.5.21-55
APACHE 2.2.22

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10275
  • VirtueMart Version: 3+
Re: Category Page Fields for Templating
« Reply #19 on: March 21, 2012, 11:00:35 am »
hollywooood, I am not going to read that code and look for a problem.

Are all images published in the "shop media files"?

AND: what happens when you take a clean category default.php, and put it in the template override folder?



I do NOT do development work for hire.

corymp

  • Jr. Member
  • **
  • Posts: 149
Re: Category Page Fields for Templating
« Reply #20 on: March 21, 2012, 11:31:10 am »
Banquet, Is there a way yet to put custom fields from the product onto the category page?
VM 2.0.4 Stable
J2.5.4

hollywooood

  • Jr. Member
  • **
  • Posts: 51
  • If everything was easy it woud be frickin awesome!
Re: Category Page Fields for Templating
« Reply #21 on: March 21, 2012, 11:38:24 am »
Hi Banquet...thanks for the reply.  All images are published in "Shop Media" and just to be sure I popped in a clean default, again, and still having the issue.  I just noticed there are spaces in the image name, would this be a problem?  I didn't think anything of this since the images show everywhere else..

also, none of the product names are showing..
Joomla 2.5.4
Virtuemart 2.0.6
PHP 5.2.17
MySQL 5.5.21-55
APACHE 2.2.22

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10275
  • VirtueMart Version: 3+
Re: Category Page Fields for Templating
« Reply #22 on: March 21, 2012, 11:47:10 am »
Hi Banquet...thanks for the reply.  All images are published in "Shop Media" and just to be sure I popped in a clean default, again, and still having the issue.  I just noticed there are spaces in the image name, would this be a problem?  I didn't think anything of this since the images show everywhere else..

also, none of the product names are showing..

have you tried the tool "install or update tables if necessary"

I do NOT do development work for hire.

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10275
  • VirtueMart Version: 3+
Re: Category Page Fields for Templating
« Reply #23 on: March 21, 2012, 11:47:43 am »
Banquet, Is there a way yet to put custom fields from the product onto the category page?

what custom field?
I do NOT do development work for hire.

corymp

  • Jr. Member
  • **
  • Posts: 149
Re: Category Page Fields for Templating
« Reply #24 on: March 21, 2012, 11:49:36 am »
If I create a custom field and place it on the product page, say Warranty. Set it to position "Waranty". Can I take that same custom field and put it on the category page for that product?
So far I have this to place a custom positioned string on my product page

Code: [Select]
<?php
if (!empty($this->product->customfieldsSorted['myposition'])) { 
       foreach (
$product->customfieldsSorted['myposition'] as $field) {
if ($field->display) {
if ($field->custom_title != $custom_title) { 
echo $field->display;
}

?>

I want to place the same custom field on the category page for the product
VM 2.0.4 Stable
J2.5.4

hollywooood

  • Jr. Member
  • **
  • Posts: 51
  • If everything was easy it woud be frickin awesome!
Re: Category Page Fields for Templating
« Reply #25 on: March 21, 2012, 11:57:36 am »
Just tried this and no luck... :o  ...any other ideas?
Joomla 2.5.4
Virtuemart 2.0.6
PHP 5.2.17
MySQL 5.5.21-55
APACHE 2.2.22

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10275
  • VirtueMart Version: 3+
Re: Category Page Fields for Templating
« Reply #26 on: March 21, 2012, 13:32:08 pm »
If I create a custom field and place it on the product page, say Warranty. Set it to position "Waranty". Can I take that same custom field and put it on the category page for that product?
So far I have this to place a custom positioned string on my product page

Code: [Select]
<?php
if (!empty($this->product->customfieldsSorted['myposition'])) { 
       foreach (
$product->customfieldsSorted['myposition'] as $field) {
if ($field->display) {
if ($field->custom_title != $custom_title) { 
echo $field->display;
}

?>

I want to place the same custom field on the category page for the product

this wont work in category. It would take some custom coding.



I do NOT do development work for hire.

hollywooood

  • Jr. Member
  • **
  • Posts: 51
  • If everything was easy it woud be frickin awesome!
Re: Category Page Fields for Templating
« Reply #27 on: March 22, 2012, 04:10:21 am »
What more information can I provide to sort out why my product data (image and product name) isn't displaying on my category page?  Any other ideas or suggestions other than the obvious on this one?  I greatly appreciate a solution on this....

Thanks in advance for any help..
Joomla 2.5.4
Virtuemart 2.0.6
PHP 5.2.17
MySQL 5.5.21-55
APACHE 2.2.22

hollywooood

  • Jr. Member
  • **
  • Posts: 51
  • If everything was easy it woud be frickin awesome!
Re: Category Page Fields for Templating
« Reply #28 on: March 22, 2012, 04:53:04 am »
I just reset all tables and installed sample data from the tools menu and still this issue occurs...Writing this off as a bug since i am unable to resolve here...appreciate all the help...
Joomla 2.5.4
Virtuemart 2.0.6
PHP 5.2.17
MySQL 5.5.21-55
APACHE 2.2.22

hollywooood

  • Jr. Member
  • **
  • Posts: 51
  • If everything was easy it woud be frickin awesome!
Re: Category Page Fields for Templating
« Reply #29 on: March 22, 2012, 14:16:21 pm »
My issue has been resolved...turns out, virtuemart does not like Falang as a translating option.  How in the heck does one figure these things out?  Turn off every plugin one by one until things start working again.  Painful process but learned a great deal...

Joomla 2.5.4
Virtuemart 2.0.6
PHP 5.2.17
MySQL 5.5.21-55
APACHE 2.2.22