Hi,
I am providing a service instead of a product so I don't need the shipping address or options forms at checkout.
I have set all my products weight to 0 which makes them virtual and have set "ENABLE DOWNLOADS = true".
I have found the location to disable the shipping address form in the /ajax/classes/AjaxManagerTest.class.php file.
However I have found that the system doesn't like not having the shipping rates disabled as it cannot proceed to the and will not respond to the virtual product type by not showing the shipping forms.
So, I decided to add a new function to load both sides of the page at the same time. I will update this with more details as I get them into place...
/ajax/javascript/ajaxManager.js
Add this function around line 216:
function ajaxPerformDualSelection(){
var shipping = getValue('shipping');
additional_fields = '';
if (selected_payment >= 0)
{
var payment = getValue('payment_'+selected_payment);
}
else
{
var payment = getValue('payment');
}
if (check_form() == true)
{
if (payment == 'ajax_authorizenet')
{
//first check if
ii = 1;
payment_fields = getElement(payment+ii);
while (payment_fields != null) {
additional_fields = additional_fields + '&' + payment_fields.name + '=' + getValue(payment_fields.id);
try {
payment_fields = getElement(payment+ii);
}
catch(err)
{
break;
}
ii++;
}
}
ajaxSendRequest('ajaxAction=PerformDualSelection&shipping='+shipping+'&payment='+payment+additional_fields,ajaxUpdateContentMulti,true,'shipping_area');
}
else return false;
return false;
}
/ajax/classes/ajaxManagerTest.class.php
Add this to the end of function ajaxManagerTest(&$arrSessionVar) (line 21)
$this->registerPageAction('PerformDualSelection','PerformDualSelection');
add this function after ajaxManagerTest(&$arrSessionVar) around line 54:
function PerformDualSelection($get)
{
$shipping_error = false;
$shipping_buffer = $this->performAction2Buffer("_PerformShippingSelection", $get ,$shipping_error);
echo '<divresult name="shipping_area">'.$shipping_buffer.'</divresult>';
$error = false;
$buffer = $this->performAction2Buffer("_PerformPaymentSelection", $get ,$error);
echo '<divresult name="payment_area">'.$buffer.'</divresult>';
$totals_error = false;
$totals_buffer = $this->performAction2Buffer("showTotals", $get, $totals_error);
echo '<divresult name="totals_area">'.$totals_buffer.'</divresult>';
$order_error = false;
$order_buffer = $this->performAction2Buffer("showPlaceOrder", $get, $order_error);
echo '<divresult name="placeorder_area">'.$order_buffer.'</divresult>';
}
For testing add modify this line at the bottom of _showPayment() around line 2230:
<td align="right"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?>
<input type="button" value="Select and Continue" onClick="ajaxPerformPaymentSelection();" id="buttonSelectPayment">
</td>
to
<td align="right">
<?php echo tep_draw_hidden_field('shipping', 'free_free','id="shipping"'); ?>
<input type="button" value="Select and Continue" onClick="ajaxPerformDualSelection();" id="buttonSelectPayment">
</td>
edit.
I have now fixed the performDualselection() function to work correctly.
Cheers.