Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How can I skip payment if price = 0?


Dennis_gull

Recommended Posts

Hey,

 

I would like to skip the confirm_payment screen if the price is 0 but if I write this:

if ( $order->info['subtotal']+$order->info['shipping_cost']==0 ) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, NULL, 'SSL'));
}

 

The shop will just send me forward and backwards and after some seconds the browser will popup a message like this: "The page isn't redirecting properly" if I skip the checkout_confirmation.php page I will get the products without selecting payment but then the product would stay in the shopping cart.

 

Is there any solution for this?

Link to comment
Share on other sites

There is a contribution named something like,"If price = 0." That will prevent the item with a price of 0 from being added to the cart.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

But then they wont be able to get a download link because they cant checkout.

Anyways I found a new contribution im going to try later, its called "Free Downloads FX" And I think its something usefull. Im not quite sure how it works yet.

Link to comment
Share on other sites

It maybe useful for orders history say, if you want to keep track of these transactions and subsequently invoke the various reports on what products where downloaded or purchased. If they just download from the products page you need to add tracking code there which is more work.

Link to comment
Share on other sites

Why would they be checking out if the price is 0?

 

Jack

 

I would like if the customers logged in before they could download the virtual item, is there a better way to do so? I admit that forcing them to checkout would be little pointless. Free Downloads FX wasnt really what I was looking for.

Link to comment
Share on other sites

You could disable the download link unless the person is logged in. Something like this pseudo code

  if (!tep_session_is_registered('customer_id')) {
echo "Please log in to see this link";
 }
 else
  tep_href_link(....

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I would like if the customers logged in before they could download the virtual item, is there a better way to do so? I admit that forcing them to checkout would be little pointless. Free Downloads FX wasnt really what I was looking for.
Dennis, I like to use the "Free of Charge" contribution to accomplish this. Works great and does not mess up your other items where there is a charge.

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

I kinda fixed this yesterday I now got:

If the price is 0 it wont show up at product_info (and you cant buy it either)

In product_listing it says Demo if its free

In the admin panel theres a place for demo's and If I fill it in It will show for members only, if the person isnt logged he will get a message like: "Download only available for subscribers"

 

Im kinda happy with that, but I was wondering If its possible to get them to go another page. For example: They click on "Download Now" and they will then come to another page where it will say: "Sending you demo.exe..." this way you you have to come to the site otherwise every other site would just be able to point to my download file.

Maybe this would be a little complex to setup? But if I just could get som hint where to look, maybe a tutorial or something.

 

 

Edit:

 

Or even better would be If I just could Hide the download link, how does that work? :)

Link to comment
Share on other sites

Okay I found out how to hide the url, this is what I did:

 

First I placed this in product_info.php:

<script>

//Hide status bar msg script- by javascriptkit.com
//Visit JavaScript Kit (http://javascriptkit.com) for script
//Credit must stay intact for use

//configure status message to show
var statusmsg=""

function hidestatus(){
window.status=statusmsg
return true
}

</script>

 

Then I place onMouseover="return hidestatus()" after the url.

This is so perfect now. All I gotta do from the add product page is to place the file name and the rest is set, I gonna store all the free downloads in /catalog/demo/

 

I remade the "product_tab" contribution a little and used one of it functions like this:

<?php 
 if (tep_session_is_registered('customer_id')) {
 if ($product_info['products_spec'] > '') {
?> </td></tr><td class="main"><b>
<a href = 'http://www.domain.com/demo/<?php
 echo $product_info['products_spec'];
 ?>' onMouseover="return hidestatus()"><?php echo TEXT_DOWNLOAD ?> </a></b><?php 
  }
}  else {
if ($product_info['products_spec'] > '') {
?> </td></tr><td class="main"> <?php
echo TEXT_ONLY;
}}
 ?>

 

And when they click on the download link they will get the product without knowing where it came from.

Link to comment
Share on other sites

damn when I press the link the url show :P

 

Guess I have to find another way to hide it :)

 

and when the visitor blocks active scripting it will also show. You cannot hide it with jscript stuff.

Link to comment
Share on other sites

I was looking for a good way to hide the link for hours but didnt find anything except the method I posted here so I came up with my own solution.

 

I stored the link inside an array so it now look like this:

 	   <?php
 $info_box_contents = array();
 $info_box_contents[] = array('form' => tep_draw_form('download_demo', tep_href_link(FILENAME_DEMO. $product_info['products_spec']), 'get'),
						   'align' => 'left',
						   'text' => tep_image_submit('download.gif', TEXT_DOWNLOAD));

 new noborderbox($info_box_contents);
?>

 

the file is $product_info['products_spec']

and the folder is FILENAME_DEMO

so I had to write this cod in filenames.php:

  define('FILENAME_DEMO', 'demo/');

 

Now theres impossible to see the download link when you hold down/click on the link even without javascript. But you can still go in to the page source and find it.

 

PS:

I tried to get a submit button without writing tep_image_submit.. but I cant get it to work, do I have to have an image on a submit button? cant it just be plain text?

Link to comment
Share on other sites

The filenames.php is to define files not folders. So you should have something like

 

define('FILENAME_DEMO', 'demo_page.php');

 

and you would need 2 files one for the catalog and another for the language. So the code will transition from the form to that page.

 

And in that new page you will just echo the headers based on what is passed from the $HTTP_GET_VARS array. Also see how the catalog\download.php sends them out so you will see what I mean.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...