Author Topic: Cart Page Fields & Modifications  (Read 135324 times)

jzdana

  • Beginner
  • *
  • Posts: 3
Re: Cart Page Fields & Modifications
« Reply #90 on: October 29, 2013, 10:20:16 am »
Many thanks for your useful topic. I would like to show category path of product as a separated field right before product name in price list on the cart page. The problem is that the fields in loop(foreach) are called from table of 'products' in Database. How can I solve it? any help would be appreciated.

jzdana

  • Beginner
  • *
  • Posts: 3
Re: Cart Page Fields & Modifications
« Reply #91 on: October 30, 2013, 12:34:31 pm »
No one has any idea?!

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10374
  • VirtueMart Version: 3+
Re: Cart Page Fields & Modifications
« Reply #92 on: October 30, 2013, 16:33:04 pm »
Many thanks for your useful topic. I would like to show category path of product as a separated field right before product name in price list on the cart page. The problem is that the fields in loop(foreach) are called from table of 'products' in Database. How can I solve it? any help would be appreciated.
I dont know about category path,
but category name & id could easily be done. It's in the array.

Atleast I know the category id is.
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

nhinzky

  • Beginner
  • *
  • Posts: 7
Re: Cart Page Fields & Modifications
« Reply #93 on: October 31, 2013, 08:43:30 am »
Hi Guys,

I want to know how can I get the fields in shipping address from this line of code(below) from the edit_address_addshipto.php under this directory (/public_html/components/com_virtuemart/views/user/tmpl):

Code: [Select]
<?php echo $this->lists['shipTo'];
I want to get the how can I display the first_name, last_name, and etc instead of displaying it using the above code. Can you help me guys?

EDIT: This post also refers to the same issue : http://forum.virtuemart.net/index.php?topic=119904.msg408199#msg408199

Thank you.

Stonedfury

  • Jr. Member
  • **
  • Posts: 266
    • Stonedfury
  • Skype Name: Stonedfury
  • VirtueMart Version: 2.0.24
Re: Cart Page Fields & Modifications
« Reply #94 on: October 31, 2013, 16:50:43 pm »
No such thing as a stupid question, only a stupid answer. I won't ask if I know the answer or found it using the search as you suggested.

jzdana

  • Beginner
  • *
  • Posts: 3
Re: Cart Page Fields & Modifications
« Reply #95 on: November 01, 2013, 16:38:35 pm »
Quote
I dont know about category path,
but category name & id could easily be done. It's in the array.

Atleast I know the category id is.

I would appreciate if you guide me how to show category name in the price list based on category id. I have tested some lines but without success.

siristru

  • Beginner
  • *
  • Posts: 11
  • VirtueMart Version: 2.x.x
Re: Cart Page Fields & Modifications
« Reply #96 on: January 03, 2014, 22:12:06 pm »
Good topic. Let me share with you my method. Virtuemart 2 has solution already :D but you need to modify it a bit. So here is what you need:

4 php files from components/com_virtuemart/views/cart/tmpl

default.php
default_pricelist.php
select_payment.php
select_shipment.php

1 file from components/com_virtuemart/views/user/tmpl

edit_address.php

Copy them to templates/[your_template]/html/com_virtuemart/cart

And now lets start. File "default.php" shows shopping cart at start and at the end of ordering process. So find this lines:

Code: [Select]
<?php if (VmConfig::get ('oncheckout_show_steps'1) && $this->checkout_task === 'confirm') {
vmdebug ('checkout_task'$this->checkout_task);
echo '<div class="checkoutStep" id="checkoutStep4">' JText::('COM_VIRTUEMART_USER_FORM_CART_STEP4') . '</div>';
?>

Should be around 90 line.

As you can see it displays "checkoutStep4" that contains info about last, 4th step of order. Now lets change it a bit:

Code: [Select]
<?php if (VmConfig::get ('oncheckout_show_steps'1) && $this->checkout_task === 'confirm') {
vmdebug ('checkout_task'$this->checkout_task);
echo 'Here is step 4 so add html code with steps in div's with images that should be displayed on the end';
} else {
echo '
Here is step 1 so add html code with steps in div's with images that should be displayed on the beginning';
}
?>

You can add whatever you want and style it in your css.

Next thing is to handle 2nd step. In my case it's login/registration page.

We need to edit edit_address.php file. Copy it to templates/[your_template]/html/com_virtuemart/user.
In this file look for line:

Code: [Select]
<h1><?php echo $this->page_title ?></h1>
Now ad after it (or in any other suitable for you) place;

Code: [Select]
<?php if (empty($this->cart->BT)){ ?>
Here is step 2 so add html code with steps in div's with images that should be displayed on the 2nd step
<?php }?>

I used in this case PRO's solution - thanks!

Ok, now you need to modify select_shipment.php
Look for this code:

Code: [Select]
if (VmConfig::get('oncheckout_show_steps', 1)) {
echo '<div class="checkoutStep" id="checkoutStep2">' . JText::_('COM_VIRTUEMART_USER_FORM_CART_STEP2') . '</div>';
}

And modify it to

Code: [Select]
if (VmConfig::get('oncheckout_show_steps', 1)) {
echo 'Here is step 3 so add html code with steps in div's with images that should be displayed on the 3nd step';
}

Now modify file select_payment.php in this line:

Code: [Select]
if (VmConfig::get('oncheckout_show_steps', 1)) {
    echo '<div class="checkoutStep" id="checkoutStep3">' . JText::_('COM_VIRTUEMART_USER_FORM_CART_STEP3') . '</div>';
}

Change it to:

Code: [Select]
if (VmConfig::get('oncheckout_show_steps', 1)) {
    echo 'Here is step 3 so add html code with steps in div's with images that should be displayed on the 3nd step';
}

My 5th step is confirmation of an order so we return to file default.php and apply changes just as I mentioned on beginning.

With bit of css styling it can look like mine:







Life example is here: http://kamizelkiodblaskowe.com.pl/koszyk.html (Shop is only in Polish, sorry ;) )

I attach my php files, icons and css style. I'm sure that you can do it much better than I ;) All you need is individual styling in css. I hope that I helped a bit ;)

[attachment cleanup by admin]
Само слога Славjанa спашава - Свуда пођи, својој кући дођи.

viperz

  • Beginner
  • *
  • Posts: 5
Re: Cart Page Fields & Modifications
« Reply #97 on: January 29, 2014, 11:09:55 am »
I Insert
Code: [Select]
<?php if (empty($this->cart->BT)){ ?> What you put here will be shown when NO billing address is completed<?php }?>

<?php if (!empty($this->cart->BT)){ ?> This shows AFTER the billing Address is completed <?php }?>
into my default.php (views/cart).


But it allways show "This shows AFTER the billing Address is completed " even if no address was filled.
 After filling the Billing adress it show "This shows AFTER the billing Address is completed "  again.


Sorry for my bad english... can somebody help me?

V 2.0

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10374
  • VirtueMart Version: 3+
Re: Cart Page Fields & Modifications
« Reply #98 on: January 31, 2014, 11:08:27 am »
I Insert
Code: [Select]
<?php if (empty($this->cart->BT)){ ?> What you put here will be shown when NO billing address is completed<?php }?>

<?php if (!empty($this->cart->BT)){ ?> This shows AFTER the billing Address is completed <?php }?>
into my default.php (views/cart).


But it allways show "This shows AFTER the billing Address is completed " even if no address was filled.
 After filling the Billing adress it show "This shows AFTER the billing Address is completed "  again.


Sorry for my bad english... can somebody help me?

V 2.0



See the first post. at the bottom after "I was getting problems with checking for billing address when default country is set."
http://forum.virtuemart.net/index.php?topic=106459.0
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

Mole_LR

  • Beginner
  • *
  • Posts: 34
Re: Cart Page Fields & Modifications
« Reply #99 on: February 03, 2014, 19:40:23 pm »
Hi!

How it's possible to "call" CustomField price into cart (so, instead of 1 Subtotal (ProductPrice), it could show:
ProductPrice: X
CustomFieldvalueprice (priceVariant): Y
Discounts...Taxes...etc...
Total: X + Y

?

Thank You!

J3DI13

  • Jr. Member
  • **
  • Posts: 77
    • GeekDimm
  • VirtueMart Version: 2.0.24c
Re: Cart Page Fields & Modifications
« Reply #100 on: March 27, 2014, 12:42:20 pm »
Hi There

How would i replace the 'Tax' & 'Discount' columns in the cart and replace it to uptput the 'cost ex vat' and 'vat'. As demonstrated in the image attached.

Your help would be greatly appreciated!

[attachment cleanup by admin]

J3DI13

  • Jr. Member
  • **
  • Posts: 77
    • GeekDimm
  • VirtueMart Version: 2.0.24c
Re: Cart Page Fields & Modifications
« Reply #101 on: April 02, 2014, 09:58:35 am »
Is there really no way of doing this?

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3010
  • VirtueMart Version: 3.6.3
Re: Cart Page Fields & Modifications
« Reply #102 on: April 02, 2014, 11:56:24 am »
Yes it is possible

You have to create a template override to the

Something like this for the headers

Code: [Select]
<tr>
<th align="left"><?php echo JText::('COM_VIRTUEMART_CART_NAME'?></th>
<th align="left"width="110px"><?php echo JText::('COM_VIRTUEMART_CART_SKU'?></th>
<th align="center" width="60px"><?php echo JText::('COM_VIRTUEMART_CART_PRICE'?></th>
<th align="center" width="90px"><?php echo JText::('COM_VIRTUEMART_CART_QUANTITY'?></th>
<?php if (VmConfig::get ('show_tax')) { ?>
<th align="center"><?php  echo "<span  class='priceColor2'>" JText::('COM_VIRTUEMART_CART_SUBTOTAL_TAX_AMOUNT') . '</span>' ?></th>
<?php ?>
<th align="center"><?php echo "<span  class='priceColor2'>" JText::('COM_VIRTUEMART_CART_SUBTOTAL_NET_AMOUNT') . '</span>' ?></th>
<th align="center"><?php echo JText::('COM_VIRTUEMART_CART_TOTAL'?></th>
</tr>


Then adjust your detail row

Code: [Select]
<td align="left" style="font-size:10px;"><?php  echo $prow->product_sku ?></td>
<td align="center">
<?php
// quorvia removed for clarity
// if (VmConfig::get ('checkout_show_origprice', 1) && $this->cart->pricesUnformatted[$pkey]['discountedPriceWithoutTax'] != $this->cart->pricesUnformatted[$pkey]['priceWithoutTax']) {
// echo '<span class="line-through">' . $this->currencyDisplay->createPriceDiv ('basePriceVariant', '', $this->cart->pricesUnformatted[$pkey], TRUE, FALSE) . '</span><br />';
// }
if ($this->cart->pricesUnformatted[$pkey]['discountedPriceWithoutTax']) {
echo $this->currencyDisplay->createPriceDiv ('discountedPriceWithoutTax'''$this->cart->pricesUnformatted[$pkey], FALSEFALSE);
} else {
echo $this->currencyDisplay->createPriceDiv ('basePriceVariant'''$this->cart->pricesUnformatted[$pkey], FALSEFALSE);
}
//  echo $prow->salesPrice ;
?>

</td>


And then your subtotal line needs some tax
Code: [Select]
<tr class="cart-subtotal">
<td colspan="4" align="right"><?php echo JText::('COM_VIRTUEMART_ORDER_PRINT_PRODUCT_PRICES_TOTAL'); ?></td>

<?php if (VmConfig::get ('show_tax')) { ?>
<td align="right"><?php echo "<span  class='priceColor2'>" $this->currencyDisplay->createPriceDiv ('taxAmount'''$this->cart->pricesUnformattedFALSE) . "</span>" ?></td>
<?php ?>
<td align="right"><?php echo "<span  class='priceColor2'>" $this->currencyDisplay->createPriceDiv ('discountedPriceWithoutTax'''$this->cart->pricesUnformattedFALSE) . "</span>" ?></td>
<td align="right"><?php echo                                 $this->currencyDisplay->createPriceDiv ('salesPrice'''$this->cart->pricesUnformattedFALSE?></td>
</tr>


And then you will want to have a total tax, which is not included in any variables and I just think that this was not considered by the Dev's to be useful, as all our customers love to calculate their own values  :o !

Code: [Select]
<tr class="cart-totals">
<td colspan="4"><?php echo JText::('COM_VIRTUEMART_CART_TOTAL'?></td>

<?php if (VmConfig::get ('show_tax')) { ?>
<td> <?php echo "<span  class='priceColor2'>" $this->currencyDisplay->createPriceDiv ('billTaxAmount'''$this->cart->pricesUnformatted['billTaxAmount'], FALSE) . "</span>" ?> </td>
<?php }
    
//quorvia has to create a net amount for the cart
    
$billNet $this->cart->pricesUnformatted['billTotal'] - $this->cart->pricesUnformatted['billTaxAmount']; //quorvia new
    
?>


    <td> <?php echo "<span  class='priceColor2'>" $this->currencyDisplay->createPriceDiv ('billNet'''$billNet FALSE) . "</span>" ?> </td>
<td><div class="bold"><?php echo $this->currencyDisplay->createPriceDiv ('billTotal'''$this->cart->pricesUnformatted['billTotal'], FALSE); ?></div></td>
</tr>[code]
[/code]


This might not be the exact format, but should get you started along the right path
regards
A

Joomla 3.9.12
php 7.2

J3DI13

  • Jr. Member
  • **
  • Posts: 77
    • GeekDimm
  • VirtueMart Version: 2.0.24c
Re: Cart Page Fields & Modifications
« Reply #103 on: April 02, 2014, 13:20:33 pm »
Thank you so much Hutson, the first bit of positive ive had for this issue. I will give it bash now, will let you know.

Again Thank You!

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3010
  • VirtueMart Version: 3.6.3
Re: Cart Page Fields & Modifications
« Reply #104 on: April 02, 2014, 22:38:41 pm »
 :)
regards
A

Joomla 3.9.12
php 7.2