Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3872548
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T21:56:16+00:00 2026-05-19T21:56:16+00:00

Is it possible to automatically set adjustment alternate SKU values for a product in

  • 0

Is it possible to automatically set adjustment alternate SKU values for a product in Ubercart?

Basically every product will have a suffix added to it’s original SKU based on the adjustment, so it would save a lot of time to populate the adjustment SKU’s automatically when the product node is created.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T21:56:16+00:00Added an answer on May 19, 2026 at 9:56 pm

    This may not be the -right- way to do it, but I created a small module that taps into the nodeapi insert operation:

    <?php
    
    function photo_form_alter(&$form, &$form_state, $form_id) {
        if ($form_id == 'photo_node_form'){
            $form['base']['model']['#default_value'] = 'placeholder';
        }
    }
    
    function photo_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
        switch($op){
            case 'presave':
                if($node->model == 'placeholder')
                    $node->model = $node->field_image_cache2[0]['filename'];    
            break;
            case 'insert':
                $nid = $node->nid;
                $sku_dl = $node->model.'d';
    
        //======  Setup Adjustments  ======
                db_query('INSERT INTO {uc_product_adjustments} (nid,combination,model) VALUES'
                    .'('.$nid.',"%s","'.$sku_dl.'"),'
                    .'('.$nid.',"%s","'.$sku_dl.'"),'
                    .'('.$nid.',"%s","'.$sku_dl.'"),'
                    .'('.$nid.',"%s","'.$sku_dl.'"),'
                    .'('.$nid.',"%s","'.$sku_dl.'")'
                    ,serialize(array('1'=>'1'))
                    ,serialize(array('1'=>'3'))
                    ,serialize(array('1'=>'4'))
                    ,serialize(array('1'=>'5'))
                    ,serialize(array('1'=>'6'))
                );
    
        //======  Add file download on purchase  ====== 
                $file_name = $node->field_image_cache2[0]['filename'];
    
                db_query("INSERT INTO {uc_files} (filename) VALUES ('%s')",$file_name);
    
                db_query("INSERT INTO {uc_file_products} (pfid, fid, model, description, shippable) VALUES (%d, LAST_INSERT_ID(), '%s', '%s', %d)", 0, $sku_dl, '', 1);
                db_query('UPDATE {uc_file_products} SET pfid = LAST_INSERT_ID() WHERE fpid = LAST_INSERT_ID() LIMIT 1');
    
                db_query("INSERT INTO {uc_product_features} (pfid, fid, nid, description) VALUES (LAST_INSERT_ID(), '%s', %d, '%s')", 'file',  $nid, '<b>Filename</b><br/>'.$file_name.'<br/> <b>Reference</b> : '.$sku_dl);
            break;  
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Not sure if it's possible but we have 2 servers set up, one automatically
Is it possible to have the width set automatically to the full width of
I have two <textField> one by one. Is possible to automatically stretch or shrink
Possible Duplicate: Is there a way to automatically update application on Android? I have
Is it possible when using TFS server to automatically have it ensure a specific
Possible Duplicate: Emacs code to automatically set indent-tabs-mode according to existing code When I'm
Is it possible to automatically transfer/ftp files to a server, every time I commit
Is it possible to set ruby-mode to automatically unindented the end? For instance, after
I have a GridView and a SqlDataSource, which I have set to automatically generate
I want to set the .tzinfo of every datetime instance automatically as soon as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.