Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

attributes sorter copier --- download filename help required


Guest

Recommended Posts

Hi

 

I am using this excellent contribution, however on the attributes listing there is no box with the filename, days to expire etc.... This is a major issue for me as I literally have thousands of downloadable products and editing the filename in the traditional attributes method is unthinkable :)

 

I was wondering if anyone could help point me in a good hacking direction to add this to the categories.php. It would need a field for filename at least which could be updated. I've spent all day trying to hack it but with no success, I guess its beyond my understanding at the moment.

 

Another way of dealing with it which would be even more useful is if this field could be updated automatically to have the same name as the product model with a zip extension added, to save typing it altogether.

 

If anyone can help me I would be very grateful! I enjoy hacking OSC and have had some success adding fields etc... but I am really stuck with this. I can't understand the relationship between the filename and theattributes from the php code point of view.

 

Andy

Link to comment
Share on other sites

Well a few more hours on and I'm still no closer. I've managed to create a field on the edit product page which automatically builds the download filename from the model. But I still can't understand the relationship between the attributes, the product and the 'attributes_filename'. Can anyone give me a hint at how to insert this into the database so it is linked to the product?

 

thanks in advance

 

Andy

Link to comment
Share on other sites

The new SEC add-on that will be released very soon does not currently have the downloads with the attributes on categories.php

 

It will probably have this added to it within a a week or two of its release.

 

I need to get the current one out the door first.

Link to comment
Share on other sites

Hi Linda

 

Thanks for responding. I've managed a very crude hack which will at least allow me to get my products in quicker. It basically sits at the bottom of your code in the update_product section of categories.php in conjunction with the code below (which is just above your table at the bottom of the page).

 

It adds the 3 fields for filename, days and downloads allowed which update ok. It also most importantly for me uses the model name to construct the zip file name. The downside is that the other 2 fields are set to 7 and 5 in here as opposed to variables but they can still be updated manually from the page. The major problems are that it will only work with a copied product using your copier, and also it takes two passes through the updating process to refresh the model name as that happens on the page load, so you have to change the model name, save and edit and save again.... Still better than venturing into the attributes section though. If you have any suggestions on how to update this as part of the below code I would be very grateful, its taken me a full day of frustration to get this far :)

 

anyhow thanks for the great contribution and your help! I look forward to the update of the copier.

 

Andy

 

/////////////////////////////// 

       if ((DOWNLOAD_ENABLED == 'true')) {

         tep_db_query("update " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " 

                       set products_attributes_filename='" . $HTTP_POST_VARS['products_attributes_filename'] . "', 

                       products_attributes_maxdays='" . $HTTP_POST_VARS['products_attributes_maxdays'] . "', 

                       products_attributes_maxcount='" . $HTTP_POST_VARS['products_attributes_maxcount'] . "' where products_attributes_id = '" . $attributes['products_attributes_id'] . "'");

       }

//////////////////////////////      

 

 

 

          <tr>

           <td class="main"><?php echo TEXT_PRODUCTS_ATTRIBUTES_FILENAME; ?></td>

           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_textarea_field('products_attributes_filename', 'soft', '70', '1', $pInfo->products_model . ".zip"); ?></td>

         </tr>

                 <tr>

           <td class="main"><?php echo TEXT_PRODUCTS_ATTRIBUTES_MAXDAYS; ?></td>

           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_textarea_field('products_attributes_maxdays', 'soft', '70', '1', 7); ?></td>

         </tr>

              <tr>

           <td class="main"><?php echo TEXT_PRODUCTS_ATTRIBUTES_MAXCOUNT; ?></td>

           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_textarea_field('products_attributes_maxcount', 'soft', '70', '1', '5'); ?></td>

         </tr>

Link to comment
Share on other sites

And you wonder why I did not toss that in yet? :D

 

I will be working on getting it in there.

 

I am concerned about the size of the screen that the attributes take up ... but the downloads and text attributes will be added once the SEC v1.0 is released.

 

Then a few other additions to Attribute handling that need to be added from the feedback I am getting on the testing.

 

Anyone know a sugar daddy who favors programmers?! 8) :wink:

Link to comment
Share on other sites

Hi Linda

 

 

If I ever make my fortune I'll certainly send some dosh your way for your great contibs :) I also use the downloads controller which is excellent.

 

So do you write code for a living?

 

Andy

Link to comment
Share on other sites

I do just about everything with computers offline.

 

In February 2002, I decided to take off as much time as possible from work and learn specifically MySQL, php and osCommerce.

 

My database background offline has been a plus and a hinderance in this, do to simlarities and differences in environment and language syntax.

 

But, it has been a great year or so for learning.

 

osCommerce has been a great base for working with code as well as people and different needs of shops all stemming from the same foundation of code.

 

Definitely keeps me off the streets ... 8)

Link to comment
Share on other sites

I know what you mean, I have been enjoying hacking the code to do specific things but I don't have enough time to study it properly at the moment, although I would like to. Its very rewarding when you set out to do something and a rediculous amount of time later its done! I would definately like to build a php based website from scratch one day.

 

well keep up the great work and I hope it earns to a serious living for you!

 

take care

Andy

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...