Author Topic: virtuemart redirect index page with no content  (Read 12929 times)

rajdavinder

  • Beginner
  • *
  • Posts: 2
virtuemart redirect index page with no content
« on: December 17, 2009, 18:06:00 pm »
Hi,

i am working with virtuemart 1.14 and php 5.2.11 versions
from from end from product detail page when i click on add to cart it redirects to index page with no content .
here is my online store link :
http://s308499038.onlinehome.us/index.php?page=shop.product_details&flypage=flypage_images.tpl&product_id=21&category_id=6&option=com_virtuemart&Itemid=81

need help   ???

thanks

patjun

  • Beginner
  • *
  • Posts: 14
    • eniky - Webdesign aus Berlin
Re: virtuemart redirect index page with no content
« Reply #1 on: December 23, 2009, 10:27:07 am »
Hi,
i got the same Problem.
Do you use a different template for your startpage?

Same in this thread:
http://forum.virtuemart.net/index.php?topic=63875.0

Patrick

Sligo

  • Beginner
  • *
  • Posts: 13
Re: virtuemart redirect index page with no content
« Reply #2 on: December 25, 2009, 01:32:22 am »
I'm also having this problem.  Whenever anything is added or removed from the VM cart, the user is redirected to www.thenameofmysite.com/index.php instead of www.thenameofmysite.com.  Is there a parameter or .php line I can change to have the re-direct go to a page of my choice?

patjun

  • Beginner
  • *
  • Posts: 14
    • eniky - Webdesign aus Berlin
Re: virtuemart redirect index page with no content
« Reply #3 on: December 26, 2009, 14:20:46 pm »
Here is my solution.

I did some changes in my theme:

File /product_detail/_includes/addtocat_form.tpl.php
row: 21
Old
Code: [Select]
<form action="<?php echo $mm_action_url ?>index.php" method="post" name="addtocart" id="<?php echo uniqid('addtocart_'?>" class="addtocart_form" <?php if( $this->get_cfg'useAjaxCartActions') && !$notify ) { echo 'onsubmit="handleAddToCart( this.id );return false;"'; } ?>>

New
Code: [Select]
<form action="<?php echo $mm_action_url ?>index.php?page=shop.cart&option=com_virtuemart&Itemid=<?php echo $Itemid ?>" method="post" name="addtocart" id="<?php echo uniqid('addtocart_'?>" class="addtocart_form" <?php if( $this->get_cfg'useAjaxCartActions') && !$notify ) { echo 'onsubmit="handleAddToCart( this.id );return false;"'; } ?>>

AND

rows: 47 - 56
Old
Code: [Select]
<input type="hidden" name="flypage" value="shop.<?php echo $flypage ?>" />
<input type="hidden" name="page" value="shop.cart" />
<input type="hidden" name="manufacturer_id" value="<?php echo $manufacturer_id ?>" />
<input type="hidden" name="category_id" value="<?php echo $category_id ?>" />
<input type="hidden" name="func" value="cartAdd" />
<input type="hidden" name="option" value="<?php echo $option ?>" />
<input type="hidden" name="Itemid" value="<?php echo $Itemid ?>" />
<input type="hidden" name="set_price[]" value="" />
<input type="hidden" name="adjust_price[]" value="" />
<input type="hidden" name="master_product[]" value="" />

New (3 rows deleted)
Code: [Select]
<input type="hidden" name="flypage" value="shop.<?php echo $flypage ?>" />
<input type="hidden" name="manufacturer_id" value="<?php echo $manufacturer_id ?>" />
<input type="hidden" name="category_id" value="<?php echo $category_id ?>" />
<input type="hidden" name="func" value="cartAdd" />
<input type="hidden" name="set_price[]" value="" />
<input type="hidden" name="adjust_price[]" value="" />
<input type="hidden" name="master_product[]" value="" />

I am not realy happy with this solution, because the theme should work without changes.

Patrick

patjun

  • Beginner
  • *
  • Posts: 14
    • eniky - Webdesign aus Berlin
Re: virtuemart redirect index page with no content
« Reply #4 on: December 26, 2009, 14:26:03 pm »
Hi Sligo,
if you want to redirect to another page, just change the page value in the form string.

Patrick

patjun

  • Beginner
  • *
  • Posts: 14
    • eniky - Webdesign aus Berlin
Re: virtuemart redirect index page with no content
« Reply #5 on: December 26, 2009, 15:19:09 pm »
And now the Patch for the Update/Delete Buttons in the Basket.
Be carefull because i did these changes in a virtuemart core file.
Backup, Backup, Backup, Backup!!!!

File /administrator/components/com_virtuemart/html/basket.php
rows: 146 - 167

old
Code: [Select]
// UPDATE CART / DELETE FROM CART
$action_url = $mm_action_url.basename($_SERVER['PHP_SELF']);
$product_rows[$i]['update_form'] = '<form action="'. $action_url .'" method="post" style="display: inline;">
<input type="hidden" name="option" value="com_virtuemart" />
<input type="text" title="'. $VM_LANG->_('PHPSHOP_CART_UPDATE') .'" class="inputbox" size="4" maxlength="4" name="quantity" value="'.$cart[$i]["quantity"].'" />
<input type="hidden" name="page" value="'. $page .'" />
<input type="hidden" name="func" value="cartUpdate" />
<input type="hidden" name="product_id" value="'. $_SESSION['cart'][$i]["product_id"] .'" />
<input type="hidden" name="prod_id" value="'. $_SESSION['cart'][$i]["product_id"] .'" />
<input type="hidden" name="Itemid" value="'. $sess->getShopItemid() .'" />
<input type="hidden" name="description" value="'. stripslashes($cart[$i]["description"]).'" />
<input type="image" name="update" title="'. $VM_LANG->_('PHPSHOP_CART_UPDATE') .'" src="'. VM_THEMEURL .'images/update_quantity_cart.png" alt="'. $VM_LANG->_('PHPSHOP_UPDATE') .'" align="middle" />
</form>';
$product_rows[$i]['delete_form'] = '<form action="'.$action_url.'" method="post" name="delete" style="display: inline;">
<input type="hidden" name="option" value="com_virtuemart" />
<input type="hidden" name="page" value="'. $page .'" />
<input type="hidden" name="Itemid" value="'. $sess->getShopItemid() .'" />
<input type="hidden" name="func" value="cartDelete" />
<input type="hidden" name="product_id" value="'. $_SESSION['cart'][$i]["product_id"] .'" />
<input type="hidden" name="description" value="'. $cart[$i]["description"].'" />
<input type="image" name="delete" title="'. $VM_LANG->_('PHPSHOP_CART_DELETE') .'" src="'. VM_THEMEURL .'images/remove_from_cart.png" alt="'. $VM_LANG->_('PHPSHOP_CART_DELETE') .'" align="middle" />
</form>';

new
Code: [Select]
// UPDATE CART / DELETE FROM CART
$action_url = $mm_action_url.basename($_SERVER['PHP_SELF'])."?option=com_virtuemart&page=".$page."&Itemid=".$sess->getShopItemid();
$product_rows[$i]['update_form'] = '<form action="'. $action_url .'" method="post" style="display: inline;">
<input type="text" title="'. $VM_LANG->_('PHPSHOP_CART_UPDATE') .'" class="inputbox" size="4" maxlength="4" name="quantity" value="'.$cart[$i]["quantity"].'" />
<input type="hidden" name="func" value="cartUpdate" />
<input type="hidden" name="product_id" value="'. $_SESSION['cart'][$i]["product_id"] .'" />
<input type="hidden" name="prod_id" value="'. $_SESSION['cart'][$i]["product_id"] .'" />
<input type="hidden" name="description" value="'. stripslashes($cart[$i]["description"]).'" />
<input type="image" name="update" title="'. $VM_LANG->_('PHPSHOP_CART_UPDATE') .'" src="'. VM_THEMEURL .'images/update_quantity_cart.png" alt="'. $VM_LANG->_('PHPSHOP_UPDATE') .'" align="middle" />
</form>';
$product_rows[$i]['delete_form'] = '<form action="'.$action_url.'" method="post" name="delete" style="display: inline;">
<input type="hidden" name="func" value="cartDelete" />
<input type="hidden" name="product_id" value="'. $_SESSION['cart'][$i]["product_id"] .'" />
<input type="hidden" name="description" value="'. $cart[$i]["description"].'" />
<input type="image" name="delete" title="'. $VM_LANG->_('PHPSHOP_CART_DELETE') .'" src="'. VM_THEMEURL .'images/remove_from_cart.png" alt="'. $VM_LANG->_('PHPSHOP_CART_DELETE') .'" align="middle" />
</form>';

Changes in the $action_url .. row and 6 Rows deleted.
I hope it works for you.

All of these patches are based on version 1.1.4

Patrick

vishnujaju

  • Beginner
  • *
  • Posts: 4
Re: virtuemart redirect index page with no content
« Reply #6 on: December 28, 2009, 18:27:51 pm »
Thanks for the solution given here.that certainly fixed the same issue I was facing for Add to Cart.

I am facing the same issue when I click on Check out..and the stages of Ship methods and Payment Method.

Any clue how to fix for those two pages as well?

Thanks,
Vishnu

pbpyrojust

  • Beginner
  • *
  • Posts: 2
Re: virtuemart redirect index page with no content
« Reply #7 on: December 30, 2009, 03:37:07 am »

I am facing the same issue when I click on Check out..and the stages of Ship methods and Payment Method.

Any clue how to fix for those two pages as well?

Thanks,
Vishnu

I to am facing these same issues on the check out. In need of some help please.

patjun

  • Beginner
  • *
  • Posts: 14
    • eniky - Webdesign aus Berlin
Re: virtuemart redirect index page with no content
« Reply #8 on: December 30, 2009, 09:48:14 am »
Hi,
i am still working at the design of the shop. Thats wy i didnt try the checkout process.

I tried the process this morning and I also face the issue.

I post the fix later today.

Greetings
Patrick

patjun

  • Beginner
  • *
  • Posts: 14
    • eniky - Webdesign aus Berlin
Re: virtuemart redirect index page with no content
« Reply #9 on: December 31, 2009, 13:40:10 pm »
Hi,
first of all. Theses changes are no solution! Just work arounds!
Dont forget Backup, Backup, Backup!

/administrator/components/com_virtuemart/classes/htmlTool.class.php
This is for the search Field on the user account page.
Row 217
Old
Code: [Select]
$header .= '<form name="adminForm" action="'.$_SERVER['PHP_SELF'].'" method="post">

New
Code: [Select]
$header .= '<form name="adminForm" action="'.$_SERVER['PHP_SELF'].'?Itemid='.$sess->getShopItemid().'" method="post">

/administrator/components/com_virtuemart/html/checkout.index.php
This is for the complete checkout process
Row 96 - 101
Old
Code: [Select]
$basket_html .= '<form action="'. SECUREURL.basename($_SERVER['PHP_SELF']) .'" method="post" name="adminForm">

<input type="hidden" name="option" value="com_virtuemart" />
<input type="hidden" name="Itemid" value="'. $Itemid .'" />
<input type="hidden" name="user_id" value="'. $auth['user_id'] .'" />
<input type="hidden" name="page" value="'. $next_page .'" />

New
Code: [Select]
$basket_html .= '<form action="'. SECUREURL.basename($_SERVER['PHP_SELF']) .'?option=com_virtuemart&page='.$next_page.'&Itemid='.$Itemid.'" method="post" name="adminForm">

<input type="hidden" name="user_id" value="'. $auth['user_id'] .'" />


/administrator/components/com_virtuemart/html/checkout.index.php
This is for adress changes
Row 287
Old
Code: [Select]
echo '<form action="'. $mm_action_url .basename($_SERVER['PHP_SELF']) .'" method="post" name="adminForm">';

Row 253, 288
New
Code: [Select]
253: global $Itemid;

288: echo '<form action="'. $mm_action_url .basename($_SERVER['PHP_SELF']) .'?option=com_virtuemart&page=checkout.index&Itemid='. $Itemid .'" method="post" name="adminForm">';
Dont forget to delete the line numbers. ;-)

/components/com_virtuemart/themes/default/templates/pages/account.billing.tpl.php
This is for adress changes
Row 30-32
Old
Code: [Select]
<input type="hidden" name="option" value="<?php echo $option ?>" />
<input type="hidden" name="page" value="<?php echo $next_page?>" />
<input type="hidden" name="Itemid" value="<?php echo $Itemid?>" />

Just delete this rows, or leave it as is.

I hope it works for you
Patrick