Posts

jquery - Woocommerce: Go to order-pay page via ajax -

i'm developing online store woocommerce right i'm struggling following thing: can go cart , checkout page using shortcodes order-pay page has no shortcode. has idea how achieve this? this how work shortcodes: jquery: $.ajax({ type: "post", url: myajax.ajaxurl, data: { action: 'getshortcode', shortcode: 'cart' }, success: function( response ){ // replace content } }); functions.php add_action("wp_ajax_getshortcode", "getshortcode"); add_action("wp_ajax_nopriv_getshortcode", "getshortcode"); function getshortcode(){ echo '<div class="wrapper">'; echo do_shortcode( '['. $_post['shortcode'] .']' ); echo '</div>'; }

bigcommerce - npm and jspm with css dependency -

i'm working library lists css dependencies in it's package.json file. here's contents of file: { "name": "bigcommerce-storefront", "description": "the new bigcommerce storefront", "version": "0.0.1", "private": true, "dependencies": { "jspm": "^0.15.1" }, "jspm": { "directories": { "baseurl": "assets" }, "dependencies": { "asyncly/eventemitter2": "github:asyncly/eventemitter2@^0.4.14", "bigcommerce-stencil/citadel": "github:bigcommerce-stencil/citadel@2.4.3", "bigcommerce-stencil/stencil-utils": "github:bigcommerce-stencil/stencil-utils@0.3.4", "browserstate/history.js": "github:browserstate/history.js@^1.8.0", "caolan/async": "github:caolan/async@^0.9.2", ...

Undefined index Opencart in home.php -

opencart version 1.5.5.1 i add code: in home.php display in home.tpl controller : <?php class controllercommonhome extends controller { public function index() { $this->document->settitle($this->config->get('config_title')); $this->document->setdescription($this->config->get('config_meta_description')); $this->data['heading_title'] = $this->config->get('config_title'); $this->dell(); // custom if (file_exists(dir_template . $this->config->get('config_template') . '/template/common/home.tpl')) { $this->template = $this->config->get('config_template') . '/template/common/home.tpl'; } else { $this->template = 'default/template/common/home.tpl'; } $this->children = array( 'common/column_left', 'common/column_right', 'common/content_top', ...

javascript - node js not working with SyntaxError: Unexpected identifier -

so, started learning node.js , tried basic thing in world: "hello world" server. the code following (copied actual book): var http = require("http"); http.createserver(function(request, response) { response.writehead(200, {"content-type": "text/plain"}); response.write("hello world"); response.end(); }).listen(8888); i hit node.js executable, type node server.js , gives famous syntaxerror: unexpected identifier . tried looking similar questions couldn't find something simple i'm trying accomplish. the node repl aka node shell, repl provides way interactively run javascript , see results. can used debugging, testing, or trying things out. here 1 how-to-use-nodejs-repl whereas, command line used run node command node server.js . you run node server.js in command line.

node.js - Node progress bar -

i working on example presented in https://github.com/tj/node-progress i have followed example word word, can't seem functionality of bar.tick() working var req = http.request({ host: 'download.github.com', port: 443, path: '/visionmedia-node-jscoverage-0d4608a.zip' }); req.on('response', function (res) { //var body = ""; var len = parseint(res.headers['content-length'], 10); console.log(); var bar = new progressbar(' downloading :bar :percent :etas', { complete: '=', incomplete: ' ', width: 20, total: len }); res.on('data', function (chunk) { //body += chunk; bar.tick(chunk.length); }); res.on('end', function () { console.log('\nfinished loading\n'); }); }); req.end(); the final output looks following downloading ==================== 100% 0.0s but instead should show p...

amazon web services - Connecting AWS with Ruby on Rails Application -

i have gone through number of questions trying resolve issues, every time solve 1 pops up. a lot of answers seem outdated. can give me simple break down on how connect ror application aws allow users download files bucket? i feel majority of errors have stemmed poor configuration on part. aws documentation hasnt been help. try aws sdk ruby - version 1 require 'aws-sdk' access_key_id = access_key_id secret_access_key = secret_access_key aws3 = aws::s3.new(access_key_id: access_key_id, secret_access_key: secret_access_key) bucket = aws3.buckets['bucket_name'] # data thru iteration bucket.objects.each |object| puts object.key puts object.read end

debugging - Python : Automatic debug logs when control goes inside/outside function -

i trying 1 project, has many functions. using standard logging module requirement log debug logs says <timestamp> debug entered foo() <timestamp> debug exited foo() <timestamp> debug entered bar() <timestamp> debug exited bar() but dont want write debug logs inside every function. there way in python takes care of automatic log containing entry , exit of functions? dont want use decorator functions, unless solution in python. thanks in advance any reason don't want use decorator? it's pretty simple: from functools import wraps import logging logging.basicconfig(filename='some_logfile.log', level=logging.debug) def tracelog(func): @wraps(func) # preserve docstring def inner(*args, **kwargs): logging.debug('entered {0}, called args={1}, kwargs={2}'.format(func.func_name, *args, **kwargs)) func(*args, **kwargs) logging.debug('exited {0}'.format(func.func_name)) return...