Zen Cart Logo
Forums / General Questions / Download links not showing all the time...

Download links not showing all the time...

Locked

Views: 1,511

Results 1 to 15 of 15
This thread is locked. New replies are disabled.
16 Jan 2010, 10:21 AM
#1
thysm00 avatar

thysm00

New Zenner

Join Date:
May 2009
Posts:
30
Plugin Contributions:
0

Download links not showing all the time...

Hi,
I've been encountering some problems lately with the download links associated with my products.

Sometimes people get the download links, and sometimes they don't... there is no rule, even with the same people. The worst is that in an order containing multiple products, some have the links and the other don't...
This did not happend before and i suspect a database problem as the attributes are set the right way...
If this has happend before to somebody or if you have an idea, please let me know.

If you also have an idea of how i could just reset the database and then import all the orders (and of course the download links). I really need to fix this as i sell mostly downloads.

16 Jan 2010, 11:05 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Download links not showing all the time...

What do you have for DB backups?
What range of time?

8 Feb 2010, 10:38 PM
#3
thysm00 avatar

thysm00

New Zenner

Join Date:
May 2009
Posts:
30
Plugin Contributions:
0

Re: Download links not showing all the time...

Well sorry i did not answer earlier... i thought the posting failed as i tried to send it from my iphone so, sorry again mods, i did not want to insist...
Anyway, the backups i have are pretty old or too recent since i have the (bad now that i need it) habit to replace the old one with the new ones...
But do you think that a database comparison could help me?

8 Feb 2010, 11:44 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Download links not showing all the time...

How exactly are your attributes set up? If you are allowing the customer to NOT select a required option, then the item will get into the cart without the required option, thus causing the corresponding download link to never be generated.

https://www.zen-cart.com/tutorials/index.php?article=190
https://www.zen-cart.com/tutorials/index.php?article=57
https://www.zen-cart.com/tutorials/index.php?article=71

9 Feb 2010, 9:15 AM
#5
thysm00 avatar

thysm00

New Zenner

Join Date:
May 2009
Posts:
30
Plugin Contributions:
0

Re: Download links not showing all the time...

The links are set up following the zencart guide and i hided the attribute box in css (display:none;) you can check it on my website, there is no way to do anything else but clicking on the buy button.

The strangest thing is that this never happened before (and i did not change anything in my products), the first cases happened in december.

9 Feb 2010, 2:27 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Download links not showing all the time...

Well, without seeing the page, or knowing exactly how you have each set up, it's almost impossible to help you.

It's also not clear whether the files are listed with each product in the order details, or if only the products are listed without the files.

9 Feb 2010, 2:37 PM
#7
thysm00 avatar

thysm00

New Zenner

Join Date:
May 2009
Posts:
30
Plugin Contributions:
0

Re: Download links not showing all the time...

ok sorry,

here is the website, i thought i had it in my signature...

acousticsamples.net

and here is for example the normal email i get after a purchase:

Products

1 x Kontr V3 = €5
Download URL
Download 2 URL

Sub-Total: €5
Download only ( ): €0
Total: €5

But sometimes, it just misses the Download URL and Download 2 URL lines and it looks like this, i fount that when the email looks like this, the links are not present in the user account as if the product had no attributes:

Products

1 x Kontr V3 = €5

Sub-Total: €5
Download only ( ): €0
Total: €5

This is when the client does not get his download links (and sometimes, even on the same order, some links appear and some don't). I installed the edit orders after that to be able to remove the product and then add it again so it will add the download links.

9 Feb 2010, 2:48 PM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Download links not showing all the time...

thysm00:

But sometimes, it just misses the Download URL and Download 2 URL lines and it looks like this, i fount that when the email looks like this, the links are not present in the user account as if the product had no attributes:

Products

1 x Kontr V3 = €5

Sub-Total: €5
Download only ( ): €0
Total: €5That's symptomatic of the customer not selecting the attributes before clicking Add-to-cart.
Merely hiding attribute choices via css doesn't absolutely prevent the customer from unchecking options that can be unchecked.

So, if you've set up your options using checkboxes and/or haven't set each to be auto-selected as default, it's not surprising that you're having the problems you describe.

Additionally, if you've copied add-to-cart links for your products and pasted them someplace else on your site to attempt to allow add-to-cart operations from other places on your site, it's possible that those links are causing you problems since they won't include any download attribute details in the links.

thysm00:

This is when the client does not get his download linksNaturally.

9 Feb 2010, 2:57 PM
#9
thysm00 avatar

thysm00

New Zenner

Join Date:
May 2009
Posts:
30
Plugin Contributions:
0

Re: Download links not showing all the time...

Ok thanks, i think i understand, but where can i set this default value?
About the links, i did not change anything i'm just setting the add to cart button in an absolute positionned div in order to have it on top of the description, but in the all products page, yep, i copied a link... so that might be it... how do you create a proper link with attributes?

Thanks again for helping me out!

9 Feb 2010, 3:18 PM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Download links not showing all the time...

thysm00:

yep, i copied a link... so that might be it... how do you create a proper link with attributes?
With attributes, it's always best to link to the product page, and NOT to an add-to-cart or buy-now button.

9 Feb 2010, 3:19 PM
#11
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Download links not showing all the time...

thysm00:

i think i understand, but where can i set this default value?As explained in the FAQ article on setting up attributes and downloads, in the Attributes Controller there are several colored buttons to let you select various options for each attribute.

9 Feb 2010, 3:33 PM
#12
thysm00 avatar

thysm00

New Zenner

Join Date:
May 2009
Posts:
30
Plugin Contributions:
0

Re: Download links not showing all the time...

Ok thanks a lot for all of your explanations!

In fact you were right! I just tested it and buying something from a copied link doesn't add attributes at all... But as i sometimes get orders with no links, that means people use the feature... i'll try to find something that adds the attributes in the link or maybe i'll use a form.

Thanks again!

9 Feb 2010, 4:51 PM
#13
thysm00 avatar

thysm00

New Zenner

Join Date:
May 2009
Posts:
30
Plugin Contributions:
0

Re: Download links not showing all the time...

Ok, i got it to work in the all_products page.

If that interests somebody, here is my (not perfect, but working :smile: ) code that has to go in line 107 of the tpl_modules_products_all_listing.php file located in your template :

      if (PRODUCT_ALL_LIST_DESCRIPTION > '0') {
      	
      	$link2 = '<form name="cart_quantity" action="index.php?main_page=product_info&products_id=' . $products_all->fields['products_id'] . '&action=add_product" method="post" enctype="multipart/form-data">';
      	$link2 .= '<input type="hidden" name="cart_quantity" value="1" />';
		$link2 .= '<input type="hidden" name="products_id" value="' . $products_all->fields['products_id'] . '" />';
		
		$sqllink2 = "SELECT  options_id ,  options_values_id FROM  products_attributes WHERE products_id =  " . $products_all->fields['products_id'];
		$resultlink2 = mysql_query($sqllink2) or die ('Erreur '.$sqllink2.' '.mysql_error());
		while ($ligne = mysql_fetch_assoc($resultlink2)) {
			$link2 .= '<input type="hidden" name="id[' . $ligne[options_values_id] . ']" value="'.$ligne[options_values_id].'" checked="checked" id="attrib-'.$ligne[options_values_id].'-'.$ligne[options_values_id].'" />';
		}

		$link2 .= '<input type="image" src="includes/templates/classic/buttons/english/button_buy_now.png" alt="Add to Cart" title=" Add to Cart " />';       
		$link2 .= '</form>';
      
        $disp_text = zen_get_products_description($products_all->fields['products_id']);
        $disp_text = zen_clean_html($disp_text);

        $display_products_description = stripslashes(zen_trunc_string($disp_text, PRODUCT_ALL_LIST_DESCRIPTION, '<a href="' . zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_all->fields['master_categories_id']) . '&products_id=' . $products_all->fields['products_id']) . '"> ' . MORE_INFO_TEXT . '</a><br><br>' . $link2));
      }

It should add a buy now button and retreive and force auto-selecting of ALL the attributes for each product.
Hope that will help somebody.

Arno

10 Feb 2010, 3:50 AM
#14
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Download links not showing all the time...

A very important caveat / limitation to note: What you've shown above will FORCE the buy-now button to add ALL attributes to the cart when the product is added. Thus, the customer is NOT offered the option of deselecting any options.
While in your particular case that is what you wanted, it may NOT be the case for most other folks.
Also, it wouldn't surprise me that the "cart_quantity" form-name will throw HTML validation errors since you're duplicating the same form multiple times on the page. That might even cause functional problems beyond just validation matters.

So ... use at own risk.

10 Feb 2010, 8:47 AM
#15
thysm00 avatar

thysm00

New Zenner

Join Date:
May 2009
Posts:
30
Plugin Contributions:
0

Re: Download links not showing all the time...

Yep that's true...
I'll name the forms differently. And also with a litle tweaking (letting input type="radio" instead of "hidden" and adding the name of the attribute next to it) anyone should be able to use the feature.

Bt yeah, use at your own risk :P:P I'm not really a php guru, i just do what i need, and obviously make a lot of mistakes :blush: