Show Posts


Messages - shahiran12395

Pages: [1] 2
1
How-to questions / gridunload
« on: August 15, 2019, 12:01:17 AM »
hi. im trying to generate new column to product list table for admin using gridunload but its not working. can advice me on how to do it

Code: [Select]
var text_choose_action = <?php js_echo($text_choose_action); ?>;
var text_select_items = <?php js_echo($text_select_items); ?>;
var _table_id = '<?php echo $data['table_id'?>';
var table_id = '#<?php echo $data['table_id'?>';
var jq_names = [<?php
foreach($data['colNames'] as $col_name){
js_echo($col_name);
echo ',';
}
//echo "'" . implode("','", $data['colNames']) . "'"
?>
];
var jq_model = [<?php
$i 1;
foreach ($data['colModel'] as $m) {
$col = array('resizable: false''title: false''searchoptions: { sopt:[\'cn\'] }');
foreach ($m as $k => $v) {
if (is_string($v)) {
$col[] = "$k: '" addslashes($v) . "'";
} else if (is_int($v)) {
$col[] = "$k: " . (int)($v);
} else if (is_bool($v)) {
$col[] = "$k: " . ($v 'true' 'false');
}
}
echo "{" implode(','$col) . "}";
if ($i count($data['colModel'])) {
echo ',';
$i++;
}
echo "\r\n";
}
?>
];

var gridFirstLoad = true;

var updatePerPage = function(records, limit) {
var html='',
rowList = [<?php echo implode(','$data['rowList']) ?>];
for (var i = 0; i < rowList.length; i++) {
if (records > rowList[i]) {
html += '<option '
+ (rowList[i] == limit ? ' selected="selected" ' : '')
+'value="' + rowList[i] + '">'
+ rowList[i] + '</option>';
}
}
if (records <= 100) {
html += '<option '+ (records == limit ? ' selected="selected" ' : '') +'value="' + records + '"><?php echo $text_all ?></option>';
}
$(table_id + '_pager_center .ui-pg-selbox').html(html);
}

    $(table_id).jqGrid('GridUnload');

2
Templates / Re: product list add new collumn
« on: August 13, 2019, 02:42:30 AM »
sorry. do you have example on how to do it. this is from my product.php

Code: [Select]
$grid_settings['colModel'] = array(
array(
'name' => 'image',
'index' => 'image',
'align' => 'center',
'width' => 65,
'sortable' => false,
'search' => false,
),
array(
'name' => 'name',
'index' => 'name',
'align' => 'center',
'width' => 200,
),
array(
'name' => 'new_column',
'index' => 'new_column',
'align' => 'center',
'width' => 120,
),

3
Templates / product list add new collumn
« on: August 12, 2019, 10:50:05 PM »
hi. i want to know how can i create new column to admin product list view in "rt=catalog/product"?

4
How-to questions / insert error into error log
« on: August 09, 2019, 05:08:37 AM »
Hi. im currently having difficulty to check whether each function i created run successfully or not because not shown at the error log. so how can i add error text to the error log so i can review it. is there any sample that i can follow on how you guys generate the error log.

5
How-to questions / add new required form field
« on: August 08, 2019, 03:20:58 AM »
Hi, im trying to add new required form field for guest checkout. But the field still can be blank without value. how can i appear error message like email field?

here is my code

Code: [Select]
if (isset($_post['nric'])){
            $nric = $_post['nric'];
        } elseif (isset($_session['guest']['nric'])){
            $nric = $_session['guest']['nric'];
        } else{
            $nric = '';
        }
        $this->data['form']['fields']['general']['nric'] = $form->getFieldHtml(
            array (
                'type'  => 'input',
                'name'  => 'nric',
                'value' => $nric,
                'required' => true,
            ));

6
How-to questions / Re: free item
« on: August 08, 2019, 01:12:56 AM »
okey. so how can i make the page redirect if customer has made 3 transaction per day if it is free item?because currently im using payment gateway to check whether the customer have reach certain transaction limit for one day sales. so for free item it will not through payment gateway but just straight away success.

7
How-to questions / free item
« on: August 07, 2019, 12:38:31 AM »
Hi guys, im wondering how the system handle item with price 0.00. Where can i see the controller?

8
Development Help Needed / send post data to new view
« on: July 25, 2019, 06:12:58 AM »
hi there, im creating new condition where if user exist in system2 the login controller will fetch the data from the system2 and auto register the user. so how can i auto submit the fetch data to rt='account/create'?

below is my code. i just need to post the data to account/create

Code: [Select]
//execute the POST request
                $result = curl_exec($ch);

                //close cURL resource
                curl_close($ch);

                if($result=="false"){
                    header('Location: ' . url.'?rt=account/login&false_entry_login_detail=1');
                    die();

                }
                $user_data = json_decode($result);

9
Customization help / Re: send welcome email error
« on: July 25, 2019, 05:49:48 AM »
its okey..i already found the error..the one dot <.> after closing the quotes that i overlooked. so right now the mail run like before.. thanks for responding

10
How-to questions / Re: readonly input
« on: July 17, 2019, 02:37:02 AM »
thanks..it help.. i just figure out how to make the input readonly. btw how can i display the label for the input? i cant display the label for my new input

11
How-to questions / Re: readonly input
« on: July 17, 2019, 02:09:15 AM »
is this the right way to set it? cause i still the same

Code: [Select]
$this->data['form']['fields']['general']['phonecode'] = $form->getFieldHtml(
            array (
                'type'  => 'input',
                'name'  => 'phonecode',
                'value' => $phonecode,
                'hidden' => true
            ));

12
How-to questions / Re: readonly input
« on: July 17, 2019, 01:26:05 AM »
i have try it but i can still insert any value into the field. the value will be assign by js function that i have create so it doesn't need any customer input.

13
How-to questions / readonly input
« on: July 17, 2019, 12:27:09 AM »
hi guys. i want to create readonly or disable input attribute. how can i set it? i try adding 'readonly'=>true in each form array but not working

Code: [Select]
$this->data['form']['fields']['general']['phone_code'] = $form->getFieldHtml(
            array (
                'type'  => 'input',
                'name'  => 'phone_code',
                'value' => $phone_code,
                'readonly' => true
            ));

14
Development Help Needed / Re: adding new input
« on: July 16, 2019, 10:54:24 PM »
I did try adding the language but still not showing the input label. am i missing something?

i have upload screenshot of the guest checkout form for other to refer below

Code: [Select]
$this->load->language('checkout/guest_step_1');

$form = new AForm();
$form->setForm(array ('form_name' => 'guestFrm'));
$this->data['form']['form_open'] = $form->getFieldHtml(
array (
                    'type'   => 'form',
                    'name'   => 'guestFrm',
                    'action' => $this->html->getSecureURL('checkout/guest_step_1'),
                    'csrf' => true
                )
        );

if (isset($_post['firstname'])){
$firstname = $_post['firstname'];
} elseif (isset($_session['guest']['firstname'])){
$firstname = $_session['guest']['firstname'];
} else{
$firstname = '';
}

$this->data['form']['fields']['general']['firstname'] = $form->getFieldHtml(array (
'type'     => 'input',
'name'     => 'firstname',
'value'    => $firstname,
'required' => true));


if (isset($_post['lastname'])){
$lastname = $_post['lastname'];
} elseif (isset($_session['guest']['lastname'])){
$lastname = $_session['guest']['lastname'];
} else{
$lastname = '';
}
$this->data['form']['fields']['general']['lastname'] = $form->getFieldHtml(
array (
'type'     => 'input',
'name'     => 'lastname',
'value'    => $lastname,
'required' => true));
if (isset($_post['email'])){
$email = $_post['email'];
} elseif (isset($_session['guest']['email'])){
$email = $_session['guest']['email'];
} else{
$email = '';
}

$this->data['form']['fields']['general']['email'] = $form->getFieldHtml(
array (
'type'     => 'input',
'name'     => 'email',
'value'    => $email,
'required' => true));
        if (isset($_post['phone_code'])){
            $phone_code = $_post['phone_code'];
        } elseif (isset($_session['guest']['phone_code'])){
            $phone_code = $_session['guest']['phone_code'];
        } else{
            $phone_code = '';
        }
        $this->data['form']['fields']['general']['phone_code'] = $form->getFieldHtml(
            array (
                'type'  => 'input',
                'name'  => 'phone_code',
                'value' => $phone_code
            ));

if (isset($_post['telephone'])){
$telephone = $_post['telephone'];
} elseif (isset($_session['guest']['telephone'])){
$telephone = $_session['guest']['telephone'];
} else{
$telephone = '';
}
$this->data['form']['fields']['general']['telephone'] = $form->getFieldHtml(
array (
'type'  => 'input',
'name'  => 'telephone',
'value' => $telephone
));

Code: [Select]
<definition>
<key>entry_firstname</key>
<value><![CDATA[First Name:]]></value>
</definition>
<definition>
<key>entry_lastname</key>
<value><![CDATA[Last Name:]]></value>
</definition>
<definition>
<key>entry_email</key>
<value><![CDATA[E-Mail:]]></value>
</definition>
<definition>
<key>entry_phone_code</key>
<value><![CDATA[Phone Code:]]></value>
</definition>
<definition>
<key>entry_telephone</key>
<value><![CDATA[Telephone:]]></value>
</definition>

15
Development Help Needed / adding new input
« on: July 16, 2019, 04:25:02 AM »
hi, im trying to add new input. but the label wont show. i have register definition using admin also add new definition in guest_step_1.xml but still no effect. below is my code. can advice me on how to do it. i need to insert phone code for different country

Code: [Select]
<definition>
<key>entry_extension</key>
<value><![CDATA[Extension:]]></value>
</definition>

Code: [Select]
if (isset($_post['extension'])){
            $extension = $_post['extension'];
        } elseif (isset($_session['guest']['extension'])){
            $extension = $_session['guest']['extension'];
        } else{
            $extension = '';
        }

        $this->data['form']['fields']['general']['extension'] = $form->getFieldHtml(
            array (
                'type'  => 'input',
                'name'  => 'extension',
                'value' => $extension
            ));

if (isset($_post['telephone'])){
$telephone = $_post['telephone'];
} elseif (isset($_session['guest']['telephone'])){
$telephone = $_session['guest']['telephone'];
} else{
$telephone = '';
}

$this->data['form']['fields']['general']['telephone'] = $form->getFieldHtml(
array (
'type'  => 'input',
'name'  => 'telephone',
'value' => $telephone
));

Pages: [1] 2

Powered by SMFPacks Social Login Mod