Jump to content

 

thelight

Member Since 31 Mar 2010
Offline Last Active Jan 12 2018 03:53 PM
-----

Topics I've Started

Change Url From Http To Https

19 February 2016 - 01:39 PM

Hi,

 

I want to move from my old e-commerce platform and change old urls to new (cs-cart) urls and also to use https on cs-cart server (I already installed SSL Certificate). How it is better to do that?

 

My idea to accomplish this is:

For 301 redirect I will add in .htaccess after 

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_URI} ^api/(.*)$ [or]
RewriteCond %{REQUEST_URI} .*/api/(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .*api/(.*)$ api.php?_d=$1 [L,QSA]
RewriteCond %{REQUEST_URI} \.(png|gif|ico|swf|jpe?g|js|css|ttf|svg|eot|woff|yml|xml)$ [or]
RewriteCond %{REQUEST_URI} store_closed.html$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*?)\/(.*)$ $2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L,QSA]

#to add after that, these redirects

Redirect 301 /old url /new_url

 

But how about moving from  http://old_url  to  https//new_url ? It's ok just to enable in CS-Cart from Settings->Security Settings->Enable secure connection for the storefront?

 

Cheers,

Chris


Call Request

15 February 2016 - 11:08 AM

Hi, I need to make available js/addons/call_requests/call_requests.js also to backend to can use phone mask in admin. I know that I have to add something like AREA == 'A'

(function(_, $){
    $.ceEvent('on', 'ce.commoninit', function(context) {

        var time_elements = context.find('.cm-cr-mask-time'),
            phone_elements = context.find('.cm-cr-mask-phone');

        if (time_elements.length === 0 && phone_elements.length === 0) {
            return true;
        }

        time_elements.mask('99:99');

        if (phone_elements.length && _.call_requests_phone_masks_list) {
            var maskList = $.masksSort(_.call_requests_phone_masks_list, ['#'], /[0-9]|#/, "mask");
            var maskOpts = {
                inputmask: {
                    definitions: {
                        '#': {
                            validator: "[0-9]",
                            cardinality: 1
                        }
                    },
                    showMaskOnHover: false,
                    autoUnmask: false
                },
                match: /[0-9]/,
                replace: '#',
                list: maskList,
                listKey: "mask"
            };

            phone_elements.each(function() {
                if (_.call_phone_mask) {
                    $(this).inputmask({
                        mask: _.call_phone_mask,
                        showMaskOnHover: false,
                        autoUnmask: false
                    });

                } else {
                    $(this).inputmasks(maskOpts);
                }
            });
        }

        if (_.call_phone_mask) {
            $.ceFormValidator('registerValidator', {
                class_name: 'cm-cr-mask-phone-lbl',
                message: _.tr('call_requests.error_validator_phone'),
                func: function(id) {
                    var input = $('#' + id);

                    if (!$.is.blank(input.val())) {
                        return input.inputmask("isComplete");
                    } else {
                        return true;
                    }
                }
            });
        }
    });

    $.ceEvent('on', 'ce.formpre_call_requests_form', function(form, elm) {
        var val_email = form.find('[name="call_data[email]"]').val(),
            val_phone = form.find('[name="call_data[phone]"]').val(),
            allow = !!(val_email || val_phone),
            error_box = form.find('.cm-cr-error-box'),
            dlg = $.ceDialog('get_last');

        error_box.toggle(!allow);
        dlg.ceDialog('reload');

        if (allow) {
            var product_data = $('[name="' + form.data('caProductForm') + '"]').serializeObject();

            $.each(product_data, function(key, value){
                if (key.match(/product_data/)) {
                    form.append('<input type="hidden" name="' + key + '" value="' + value + '" />');
                }
            });
        }

        return allow;
    });

})(Tygh, Tygh.$);


Discount Configuration

03 November 2015 - 07:07 PM

Hi,

 

I have a product (Balloons) for which I created a quantity discount: for 2 bags price is lower with 5% and for 5 bags price is lower with 10%.

 

Now, I want to give to a certain customer 12% discount for entire order but for the balloons I want to keep the above rules (for 2 bags 5% discount and for 5 bags 10% discount). There is a way to do this?

 

Thanks. 


Phone Mask To Checkout Page

23 October 2015 - 10:36 AM

Hello,

 

How to add phone mask to phone field on checkout page, like on the Buy now with 1-click pop-up?

 

Thanks.


Uncaught Typeerror: Cannot Read Property 'replace' Of Null

21 June 2015 - 03:21 PM

When I enable in config.php define('DEVELOPMENT', true); I received a blank page on front store with an error:
Uncaught TypeError: Cannot read property 'replace' of null

Attached File  Screen Shot 2015-06-21 at 18.20.59.png   26.8KB   89 downloads