Jump to content

werushka

Members
  • Posts

    94
  • Joined

  • Last visited

Profile Information

  • Gender
    Female

werushka's Achievements

Member

Member (2/5)

0

Reputation

  1. this is the link t('ETİKET') for img what should I change it to ????
  2. I have a line like this it prints text link but I prefer image link how should i edit it I would appreciate some feedback $templates['etiket'] = array('name' => t('ETİKET'), 'module' => 'uc_invoice_pdf', 'path' => $templates_uc_invoice_pdf_path, 'pdf_settings' => $pdf_settings);
  3. I tried this and is working perfect, I really appreciate your help guys <?php if (substr($product->title, 0, 2) == "01"){ echo t('Earring');}?>
  4. I appreciate your fast reply I have written this but gave me white screen of death, I couldn't understand why <?php if (substr($product['title'], 0, 2) == "01"){ print "Earring";}?>
  5. I have a code which I made just up <?php if ($product->title == '01'); print "Earring"; ?> <?php if ($product->title == '02'); print "Necklace"; ?> <?php if ($product->title == '03'); print "Necklace"; ?> <?php if ($product->title == '04'); print "Ring"; ?> I just want to check the product titles first 2 characters and print according to that. Example: If $product->title is "01DSE32" print Earring. This checking must be strgn or something like that which I don't remember. I would appreciate some feedback.
  6. thank you very much litebearer the following code works perfectly <?php foreach ($order->products as $product) { $my_array[] = $product->model; } $max_columns = 4; /* set max columns for table */ $i = 0; /* initially set counter to use in starting and ending rows */ ?> <table border ="2"> <?php $total_cells = count($my_array); /* count total cells to be displayed */ $total_rows = ceil($total_cells / $max_columns); /* calculate total rows needed */ $junk1 = $total_rows * $max_columns; /* calculate number of empty cells in last row */ $junk2 = $junk1 - $total_cells; if($junk2==0) { $last_row = "</tr>"; }else{ $j = 0; while($j<$junk2){ $last_row = $last_row . "<td></td>"; $j ++; } $last_row = $last_row . "</tr>"; } $x=0; while($x <$total_cells) { /* begin looping thru the results */ if($i == 0){ echo "<tr>"; $i ++; } ?> <td><?php echo $my_array[$x]; ?></td> <?php $x ++; $i ++; if($i > $max_columns) { /* check if need to close row */ echo "</tr>"; $i=0; } } echo $last_row . "</table>"; /* clean up last row */ ?>
  7. I have simplified my code <?php { foreach ($order->products as $product) { echo $product->model; }}?> this code alone gives me all the products in the DB. in a single raw. But I need to implement this to only this code $my_array = array ("123","456","789","101","222","879","245","908","12345","2468","9922"); but I don't know how to make my line of code implemented to my_array
  8. anyone pleasee I still couldnt solve this
  9. thanks for the code but I wasn't even able to modify the one that jcbones given to me. This seems even more confusing
  10. I think I come this far but still can't solve it : <table border="0" cellspacing="5" cellpadding="5"> <?php if (is_array($order->products)) { $context = array( 'revision' => 'formatted', 'type' => 'order_product', 'subject' => array( 'order' => $order, ), ); foreach ($order->products as $product) { $price_info = array( 'price' => $product->price, 'qty' => $product->qty, ); $context['subject']['order_product'] = $product; $context['subject']['node'] = node_load($product->nid); ?> <?php; $i = 0; echo ($i != 0 && $i < 4) ? NULL: '<tr>'; foreach(explode('<tr>',$product->model) as $value) { echo '<td>' . str_replace('<br />','',$value) . '</td>'; if(++$i == 4) { echo '</tr>'; $i = 0; } } echo ($i != 0 && $i < 4) ? '</tr>' : NULL; ?> <?php } }?></table> The out put is <table border="0" cellspacing="5" cellpadding="5"> <tr><td>SKU: 123</td></tr> <tr><td>SKU: 322</td></tr> <tr><td>SKU: 444</td></tr> <tr><td>SKU: 555</td></tr> <tr><td>SKU: 666</td></tr> </table> but it supposed to be <table border="0" cellspacing="5" cellpadding="5"> <tr><td>SKU: 123</td> <td>SKU: 322</td> <td>SKU: 444</td> <td>SKU: 555</td></tr> <tr><td>SKU: 666</td></tr> </table>
  11. thanks for your fast reply but it gives an empty page
  12. I am editing code to get sku numbers, for now it just prints as below: SKU: 123 SKU: 322 SKU: 444 SKU: 555 SKU: 666 I want to put them in columns so it prints as: SKU: 123 SKU: 322 SKU: 444 SKU: 555 SKU: 666 etc. etc. So it is devided into 4 columns. The code that controls is: <?php if (is_array($order->products)) { $context = array( 'revision' => 'formatted', 'type' => 'order_product', 'subject' => array( 'order' => $order, ), ); foreach ($order->products as $product) { $price_info = array( 'price' => $product->price, 'qty' => $product->qty, ); $context['subject']['order_product'] = $product; $context['subject']['node'] = node_load($product->nid); ?> <?php echo $product->model; ?><br /> <?php } }?> i would appreciate some help
  13. I am new to php and I need to write this code simpler..I would appreciate any help function my_module_form_alter(&$form, &$form_state, $form_id) { if ($form['field_age_value']) { $form['field_age_value']['#type'] = "select"; $form['field_age_value']['#options'] = array(All=>"<All>",32=>"32",33=>"33"); $form['field_age_value']['#default_value'] = No; $form['field_age_value']['#size'] = null; } if ($form['field_burc_value']) { $form['field_burc_value']['#type'] = "select"; $form['field_burc_value']['#options'] = array(All=>"Farketmez",Akrep=>"Akrep",Yay=>"Yay",Oglak=>"Oğlak"); $form['field_burc_value']['#default_value'] = No; $form['field_burc_value']['#size'] = null; } }
  14. I have tried with the special charaters thing and this does not seem to work.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.