VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: meldmeaan on June 21, 2012, 10:26:00 AM

Title: Disabble or remove shipping address ***SOLVED***
Post by: meldmeaan on June 21, 2012, 10:26:00 AM
Hi,
I want to disable of remove the shipping adrress in VM 2.
This because the invoice adress is ALWAYS the same as the shipping adress
Now i have configured VM so that i dont have to fill in the shipping adress and i can process an order.
But...
Why let customers see an option that they will never use ?
So i have tried to modify /components/com_virtuemart/views/cart/tmpl/shopper_adresses.
I have deleted the next section :
<td width="50%">
         <?php
         if(!empty($this->STaddress['fields'])){
            foreach($this->STaddress['fields'] as $item){
               if(!empty($item['value'])){
                  echo $item['title'].': '.$this->escape($item['value']).'<br/>';
               }
            }
         } else {
         foreach($this->BTaddress['fields'] as $item){
            if(!empty($item['value'])){
               echo $item['title'].': '.$this->escape($item['value']).'<br/>';
            }
         }
      } ?>
</td>

But that does not work.
I still see an option for filling in a STadress....
What am i doing wrong ??

Greetings,

Meldmeaan
Title: Re: Disabble or remove shipping address
Post by: Renata on June 24, 2012, 02:24:17 AM
Dear all

I would like to remove the possibility of adding a shipping address too. I have purchased this plug-in: Shipment for Virtual Products

So all the products of our webshop will be downloaded and there is no need to ask for a shipment address anymore.

As we would like to make the steps as easy as possible for our clients and because of that we would like to have no unrelated questions in the cart, could you please advise how to remove this question?

I have tried to change a lot of ""views" and searched for answers but with no success

I hope to hear from you soon.

Kind regards
Renata
Title: Re: Disabble or remove shipping address
Post by: jenkinhill on June 24, 2012, 11:51:30 AM
Some clues:
http://forum.virtuemart.net/index.php?topic=103789.msg345002#msg345002
http://forum.virtuemart.net/index.php?topic=101678.msg337154#msg337154

I have not tried any of this as for the sites I have done, all need shipping.
Title: Re: Disabble or remove shipping address
Post by: Renata on June 24, 2012, 13:01:30 PM
Dear jenkinhill

Thank you so much! (you helped me often for which i want to give you my special thanks!)

For everybody who wants to remove shipping address, pls remove following code from /components/com_virtuemart/views/cart/tmpl/default_pricelist.php. I tested it and everything else still works in good order:


<div class="width50 floatleft">

<span><span class="vmicon vm2-shipto-icon"></span>
<?php echo JText::_('COM_VIRTUEMART_USER_FORM_SHIPTO_LBL'); ?></span>
<?php // Output Bill To Address ?>
<div class="output-shipto">
<?php
if(empty($this->cart->STaddress['fields'])){
echo JText::sprintf('COM_VIRTUEMART_USER_FORM_EDIT_BILLTO_EXPLAIN',JText::_('COM_VIRTUEMART_USER_FORM_ADD_SHIPTO_LBL') );
} else {
if(!class_exists('VmHtml'))require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'html.php');
echo JText::_('COM_VIRTUEMART_USER_FORM_ST_SAME_AS_BT'). VmHtml::checkbox('STsameAsBT',$this->cart->STsameAsBT).'<br />';
foreach($this->cart->STaddress['fields'] as $item){
if(!empty($item['value'])){ ?>

<!-- <span class="titles"><?php echo $item['title'?></span> -->
<?php
if ($item['name'] == 'first_name' || $item['name'] == 'middle_name' || $item['name'] == 'zip') { ?>

<span class="values<?php echo '-'.$item['name'?>" ><?php echo $this->escape($item['value']) ?></span>
<?php } else { ?>
<span class="values" ><?php echo $this->escape($item['value']) ?></span>
<br class="clear" />
<?php
}
}
}
}
 
?>

<div class="clear"></div>
</div>
<?php if(!isset($this->cart->lists['current_id'])) $this->cart->lists['current_id'] = 0?>
<a class="details" href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=ST&cid[]='.$this->cart->lists['current_id'],$this->useXHTML,$this->useSSL?>">
<?php echo JText::_('COM_VIRTUEMART_USER_FORM_ADD_SHIPTO_LBL'); ?>
</a>

</div>


only when you want to change ""bill to" address, so you click on that, than in that case still at the bottom of that page is showing: add/alter shipping address. I will look into this and hope to find a solution for that too. (however i am already very happy with the result right now)

Kind regards
Renata 

Title: Re: Disabble or remove shipping address
Post by: enricocerica on June 24, 2012, 14:00:42 PM
Thanks Renata, exactly what I was looking for  ;)

Here is my contribution, to remove the link "add/alter shipping address" when changing the "bill to address" just remove the following code in \components\com_virtuemart\views\user\tmpl\edit_address.php (at the end of the code) :

<?php // }
if ($this->userDetails->JUser->get('id')) {
    echo 
$this->loadTemplate('addshipto');
  } 
?>

<input type="hidden" name="option" value="com_virtuemart" />
<input type="hidden" name="view" value="user" />
<input type="hidden" name="controller" value="user" />
<input type="hidden" name="task" value="<?php echo $this->fTask// I remember, we removed that, but why?   ?>" />
<input type="hidden" name="address_type" value="<?php echo $this->address_type?>" />
<?php if(!empty($this->virtuemart_userinfo_id)){
echo '<input type="hidden" name="shipto_virtuemart_userinfo_id" value="'.(int)$this->virtuemart_userinfo_id.'" />';
}
echo 
JHTML::_('form.token');
?>

Title: Re: Disabble or remove shipping address
Post by: Renata on June 24, 2012, 18:43:41 PM
Dear enricocerica

Thanks for your help! You have put me on the right way, but there was a problem:

If you are logged in and want to change your bill-to address indeed the shipping address has disappeared. But when you click on "save" you wont be able to return to the shoppingcart, but stay on the same page. Only if you click on cancel you are able to leave that page.

After testing i found the solution:

Just remove the following code from the concerning file:


{
    echo $this->loadTemplate('addshipto');
  }


And problem is solved.

Kind regards and thanks for your help.

Renata
Title: Re: Disabble or remove shipping address
Post by: enricocerica on June 24, 2012, 22:22:07 PM
Thumbs up Renata  ;)
It works perfectly.
Title: Re: Disabble or remove shipping address
Post by: Renata on June 25, 2012, 10:29:56 AM
Quote from: enricocerica on June 24, 2012, 22:22:07 PM
Thumbs up Renata  ;)
It works perfectly.

8) 8)  ;D thanks! (no blush smiley available unfortunately lol)
Title: Re: Disabble or remove shipping address
Post by: meldmeaan on June 28, 2012, 16:24:13 PM
Manny Manny thanks !!
This works great !!!
Put status to solved !!

Greetings
Meldmeaan
Title: Re: Disabble or remove shipping address
Post by: 16ibs29 on July 06, 2012, 16:33:01 PM
Quote from: Renata on June 24, 2012, 18:43:41 PM
Dear enricocerica

Thanks for your help! You have put me on the right way, but there was a problem:

If you are logged in and want to change your bill-to address indeed the shipping address has disappeared. But when you click on "save" you wont be able to return to the shoppingcart, but stay on the same page. Only if you click on cancel you are able to leave that page.

After testing i found the solution:

Just remove the following code from the concerning file:


{
    echo $this->loadTemplate('addshipto');
  }


And problem is solved.

Kind regards and thanks for your help.

Renata

Hello Renata!

Which file is this line found?

Thanks!!

RD
Title: Re: Disabble or remove shipping address ***SOLVED***
Post by: Renata on July 06, 2012, 16:39:02 PM
hello

this file:

\components\com_virtuemart\views\user\tmpl\edit_address.php
Title: Re: Disabble or remove shipping address ***SOLVED***
Post by: 16ibs29 on July 06, 2012, 21:10:10 PM
Thank you.
Title: Re: Disabble or remove shipping address
Post by: letsneck on July 08, 2012, 09:59:19 AM
Quote from: enricocerica on June 24, 2012, 14:00:42 PM
Thanks Renata, exactly what I was looking for  ;)

Here is my contribution, to remove the link "add/alter shipping address" when changing the "bill to address" just remove the following code in \components\com_virtuemart\views\user\tmpl\edit_address.php (at the end of the code) :

<?php // }
if ($this->userDetails->JUser->get('id')) {
    echo 
$this->loadTemplate('addshipto');
  } 
?>

<input type="hidden" name="option" value="com_virtuemart" />
<input type="hidden" name="view" value="user" />
<input type="hidden" name="controller" value="user" />
<input type="hidden" name="task" value="<?php echo $this->fTask// I remember, we removed that, but why?   ?>" />
<input type="hidden" name="address_type" value="<?php echo $this->address_type?>" />
<?php if(!empty($this->virtuemart_userinfo_id)){
echo '<input type="hidden" name="shipto_virtuemart_userinfo_id" value="'.(int)$this->virtuemart_userinfo_id.'" />';
}
echo 
JHTML::_('form.token');
?>



This part of the solution did not work for me. I am working with Virtuemart 2.0.8 and Joomla 1.5.25. The first part of the solution by Renata removed most everything correctly, but I am still left with the following part .....

Ship To
Only in case shipment address is different from billing address,
click »Add/Edit shipment address« button below
   
      Add/Edit shipment address


Please will you help to solve this for me? Thank you
Title: Re: Disabble or remove shipping address ***SOLVED***
Post by: Renata on July 08, 2012, 11:31:40 AM
Dear letsneck

In my case if you change above two scripts all disappeared! perheps you did something wrong? 

If you want an easier way to remove all concerning shipment address, you might consider to buy OPC: one page checkout. With this extension there is a possibility to remove all concerning shipment address just by one click. But it is a commercial extension. (worth paying IMHO)

Kind regards
Renata
Title: Re: Disabble or remove shipping address ***SOLVED***
Post by: letsneck on July 08, 2012, 20:15:06 PM
Thank you for your reply Renata. I am not sure what I could have done wrong. Your contribution removed everything except the remaining "Ship to add edit" that was at the bottom of the section once you click on "add/edit Billing address". I removed the code exactly as it appeared in the Post by: enricocerica.

Perhaps it is a version issue. I am running virtuemart 2.0.8 with joomla 1.5.25. I did notice that I had an extra line in the code that wasn't in the code you posted for the first part of the fix. The line is as follows...

<input type="hidden" name="billto" value="<?php echo $this->cart->lists['billTo']; ?>"/>

I removed the line with the rest of the code, as it was just above the last line </div>.

I also noticed that I have a file called edit_address_addshipto.php and one called edit_address_addshipto.php.org. Should I be editing those files instead?
Title: Re: Disabble or remove shipping address ***SOLVED***
Post by: Renata on July 08, 2012, 20:32:11 PM
Dear letsneck

I think you removed more as suggested here above. Just remove what is suggested in the replies #3 and #5

I don't work with joomla 1.5 as this version is not supported by Joomla anymore. So i cant help you to solve this problem. Just this:

if you have removed the line as suggested in #5 you have broken the chain of scrips who are pointing to the shipment addresses. I don't know whether or not this differs when you use a different joomla version. For me it worked!

I hope someone else can help you

success
Kind regards
Renata
Title: Re: Disabble or remove shipping address ***SOLVED***
Post by: The big on July 16, 2012, 17:47:41 PM
Hello Renata and others  :)

I too would like to remove the billing address information.

I have removed the lines that have been invoked in the previous posts, but I'm still getting billing address information.

Any thoughts, maybe I've done something wrong ??


[attachment cleanup by admin]
Title: Re: Disabble or remove shipping address ***SOLVED***
Post by: Renata on July 16, 2012, 18:03:51 PM
Quote from: The big on July 16, 2012, 17:47:41 PM
Hello Renata and others  :)

I too would like to remove the billing address information.

I have removed the lines that have been invoked in the previous posts, but I'm still getting billing address information.

Any thoughts, maybe I've done something wrong ??


This topic concerns removing shipping address, not removing billing address.

Kind regards
Renata
Title: Re: Disabble or remove shipping address ***SOLVED***
Post by: ravsimple on August 29, 2012, 19:39:17 PM
Another quick way to hide it is via the CSS! As the above did not work for me
Title: Re: Disabble or remove shipping address
Post by: anchel on March 26, 2013, 14:38:35 PM
Quote from: Renata on June 24, 2012, 18:43:41 PM
Dear enricocerica

Thanks for your help! You have put me on the right way, but there was a problem:

If you are logged in and want to change your bill-to address indeed the shipping address has disappeared. But when you click on "save" you wont be able to return to the shoppingcart, but stay on the same page. Only if you click on cancel you are able to leave that page.

After testing i found the solution:

Just remove the following code from the concerning file:


{
    echo $this->loadTemplate('addshipto');
  }


And problem is solved.

Kind regards and thanks for your help.

Renata

Hi struggeling with this... i found everything and also removed everything mentioned, then I get stuck at this specific point, only problem is that even if i update the address it does not even save, and also only returns to the page with cancel, like u mentioned.

only problem is that there is no


{
    echo $this->loadTemplate('addshipto');
  }


in my page to remove...??? what to do?? PLEASE HELP SOMEONE...

Title: Re: Disabble or remove shipping address ***SOLVED***
Post by: Stonedfury on April 30, 2013, 18:23:18 PM
I want to display the shipto but only if they want to ship to another address ie, a check box then magically appearing shipto box. I wonder where that would be established in this edit you are employing.
Title: Re: Disabble or remove shipping address ***SOLVED***
Post by: Stonedfury on April 30, 2013, 19:02:25 PM
Well thanks to this post I figured it out. The ship to and bill to will only load if you actually put one in. The buttons (thanks to Pros Help) load if there is no billto and disappear if there is and the boxes appear for edit billing. Today is looking up. www.pollenranch.com/store/cart
Title: Re: Disabble or remove shipping address ***SOLVED***
Post by: Carl F on March 08, 2014, 20:52:18 PM
HELP. I tried to edit the default_pricelist.php file as suggested by Renata (a couple of years ago) and it didn't work. Now I get the following error:

Parse error: syntax error, unexpected '}' in /home/content/e/w/m/ewmacro/html/staging/components/com_virtuemart/views/cart/tmpl/default_pricelist.php on line 1

I believe this is because I edited the file in Word Pad instead of Notepad. YES, I'm a novice. I thought I could always put it back, but nothing works at this point.

Is there a way to fix this?

OR, can somebody send me the file so I can upload it and live with the ugly shipping address block that I totally don't need?

I'm using version 2.0.26d.

Title: Re: Disabble or remove shipping address ***SOLVED***
Post by: kyuzo on October 03, 2014, 15:32:57 PM
Here is the solution for removing Add/Edit shipment address from the bottom part of the template.

Edit /com_virtuemart/views/user/tmpl/edit_shopper.php and remove/comment this line (32):

echo $this->loadTemplate('address_addshipto');