Jump to content

 

0range

Member Since 05 Mar 2017
Offline Last Active Mar 22 2017 01:01 AM
-----

Topics I've Started

How To Add A Dummy Field With A Blank Value When Exporting

21 March 2017 - 12:55 PM

Hello 

 

When exporting a csv file, I would like to insert a dummy field with a blank value after a certain export_field. Is there a way of doing this without adding a new column to the data table?

Thank you in advance. 


How Can I Get Category Data From The Cart Products

13 March 2017 - 09:03 AM

Hi

 

I want to prevent my customers from buying products in two different categories. 

Is there a way to get category data from the cart products?

 

I think I need to use the fn_get_cart_products hook, but I couldnt figure out how . 

Thank you in advance. 


When Exporting Order Items, Same Item Appears But In Different Languages

10 March 2017 - 10:44 AM

Hi

 

Currently Im using two languages in my store. 

The problem I encountered is that when I export order items,

the same item appears twice in different languages. 

 

E.G.

 

Order ID

Item ID

Date

Store

Note

First Name

Last Name

User Id

Billing Country

Billing Zipcode

Billing State

Billing Address

Billing Address2

Billing Phone

Email

Shipping Firstname

Shipping Lastname

Shipping Country

Shipping Zipcode

Shipping State

Shipping Address

Shipping Address2

Shipping Phone

Payment Id

Shipping Id

Subtotal

Total

Shipping Cost

Payment Surcharge

Discount

Detail

Status

Product code

Product Name

Price

Quantity

Product Options Variants

1388

1110503342

1489140477

1

 

日本

太郎

1

JP

107-0052

東京都

赤坂1-2-34

CS第二ビル7F

01-2345-6789

shota.irieda@mebuku.co.jp

日本

太郎

JP

107-0052

東京都

赤坂1-2-34

CS第二ビル7F

01-2345-6789

6

8

730

2470

1740

0

0

 

O

B00F3IUN27

Packard Bell OneTwo

730

1

 

1388

1110503342

1489140477

1

 

日本

太郎

1

JP

107-0052

東京都

赤坂1-2-34

CS第二ビル7F

01-2345-6789

shota.irieda@mebuku.co.jp

日本

太郎

JP

107-0052

東京都

赤坂1-2-34

CS第二ビル7F

01-2345-6789

6

8

730

2470

1740

0

0

 

O

B00F3IUN27

パッカード・ベル OneTwo

730

1

 

 

 

I want the above to be like:

 

Order ID

Item ID

Date

Store

Note

First Name

Last Name

User Id

Billing Country

Billing Zipcode

Billing State

Billing Address

Billing Address2

Billing Phone

Email

Shipping Firstname

Shipping Lastname

Shipping Country

Shipping Zipcode

Shipping State

Shipping Address

Shipping Address2

Shipping Phone

Payment Id

Shipping Id

Subtotal

Total

Shipping Cost

Payment Surcharge

Discount

Detail

Status

Product code

Product Name

Price

Quantity

Product Options Variants

1388

1110503342

1489140477

1

 

日本

太郎

1

JP

107-0052

東京都

赤坂1-2-34

CS第二ビル7F

01-2345-6789

shota.irieda@mebuku.co.jp

日本

太郎

JP

107-0052

東京都

赤坂1-2-34

CS第二ビル7F

01-2345-6789

6

8

730

2470

1740

0

0

 

O

B00F3IUN27

パッカード・ベル OneTwo

730

1

 

 

 

Is there a way to limit to only one language?

This does not happen when I export products. 

 

Thank you in advance. 

 

 


Custom Datetime Column In The Products Table Gets Overwritten

06 March 2017 - 03:22 AM

Hi
 
I created a DATETIME column in the cscart_products table and a corresponding input form in update.tpl. 
When I update the products, it works fine the first time. However, if I make a change in other inputs, such as the product name, the value in the DATETIME column I’ve created gets overwritten to 0. 
 
A custom STRING field in the products table does not get overwritten, but only this DATETIME column.
Any idea why this is happening? Thank you in advance. 
 
 
Below are the codes:
 
/backend/templates/products/update.tpl

<div class="control-group">
  <label class="control-label" for="elm_date_avail_until_holder">{__("available_until")}:</label>
      <div class="controls">
         <div class="ty-calendar" style="position:relative;display:inline-block">
            <input type="text" id="elm_date_avail_until_holder" name="product_data[avail_until]" class="cm-calendar" style="padding-left:24px;width: 105px !important;" value="{if $product_data.avail_until}{$product_data.avail_until|date_format:"`$date_format`"}{/if}" {$extra} size="12" />
               <i class="icon-calendar cm-external-focus" style="position:absolute;top: 6px;left: 6px;"></i>
         </div>
      </div>
</div>

/controllers/backend/products.php
 
in ($mode == ‘m_override’)
 

if (isset($product_data['avail_until'])) {
                $product_data['avail_until'] = $product_data['avail_until'];
            }

under

if (isset($product_data['avail_since'])) {
                $product_data['avail_since'] = fn_parse_date($product_data['avail_since']);
            }

in($mode == ‘m_update’)

'avail_until' => 'products_data',

under

'avail_since' => 'products_data',
 

and 


elseif ($field == 'avail_until') {
            $desc = 'available_until';
        }

under

elseif ($field == 'avail_since') {
            $desc = 'available_since';
        }