Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Fetching price in admin


Elvikom

Recommended Posts

Hello.

 

I'm looking for a contribution, which allow me to add a "fetching price" field for product.

For example: I buyed an IC for $20. I will sell it in my shop for $25.

I want, i can insert and save the "fetching price" ($20) in database. It will display only in the product card (in admin area).

 

Now i must remember, what is the price from my supplier, or write it wherever.

I will NOT remember and NOT write this anytime.

 

Is the contribution for adding own fields to product card, with saving inserted data in database, only for admin preview?

 

Please for help, dear Friends.

And sorry for my weak english :/

Link to comment
Share on other sites

It's good solution, but few errors:

 

1. In PHP code (lines marking "------>>" it is my correction added):

OPEN: /catalog/admin/categories.php

FIND:

<td class="main"><?php echo TEXT_PRODUCTS_TAX_CLASS; ?></td>
------>> <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id, 'onchange="updateGross()"'); ?></td>

ALTER TO:

           <td class="main"><?php echo TEXT_PRODUCTS_TAX_CLASS; ?></td>
           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id, 'onchange="updateGross()"'); ?></td>
         </tr>
      	  <?php
      	  /*
      	  ADDED FOR COST MARGIN MOD
      	  START OF CODE ADDITION
      	  */
      	  ?>
         <tr bgcolor="#ebebff">
           <td class="main"><?php echo TEXT_PRODUCTS_PRICE_COST; ?></td>
           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_cost', $pInfo->products_cost, 'OnKeyUp="updateMargin()"'); ?></td>
         </tr>
         <tr bgcolor="#ebebff">
           <td class="main"><?php echo TEXT_PRODUCTS_PRICE_MARGINS; ?></td>
           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' ?><span id='products_price_margins'></div></td>
         </tr>
      	  <?php
      	  /*
      	  ADDED FOR COST MARGIN MOD
      	  END OF CODE ADDITION
      	  */
         ------>> ?>

2. Inserted "product cost" value will NOT save in database.

I still work for solve this, maybe You have an idea, how to make this value writable in database?

 

Thank You very much for help, dear DunWeb!

Regards

Edited by Elvikom
Link to comment
Share on other sites

Hello again.

I solved "price cost write database" problem.

 

1. OPEN: /catalog/admin/categories.php

 

2. FIND (around line 382):

$product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");

 

3. IN-LINE FIND:

p.products_price, p.products_weight,

 

4. ALTER TO:

p.products_price, p.products_cost, p.products_weight,

 

5. CLOSE AND SAVE THE FILE.

 

That's all.

Kind regards and many thanks for help!

Lukasz

Edited by Elvikom
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...