Skip to content

Instantly share code, notes, and snippets.

View inspiran's full-sized avatar

Daniel Kucharski inspiran

View GitHub Profile
//Determine how the price will be calculated
$pricingSetConfiguration->addPricingExecutionStep(
new SetPricingElementFromContainerValue(
array('container' => 'net_value',
'pricing_element' => 'net_value')));
$pricingSetConfiguration->addPricingExecutionStep(
new SetValue(
array('container' => 'packaging_cost_factor',
'value' => '0.05')));
@inspiran
inspiran / gist:913426
Created April 11, 2011 12:22
github error
vespolina@server:/var/www/vhosts/vespolina.org/httpdocs/vespolina-site# git push origin
Enter passphrase for key '/home/vespolina/.ssh/id_rsa':
Counting objects: 170, done.
Delta compression using up to 8 threads.
fatal: unable to create thread: Resource temporarily unavailable
error: pack-objects died with strange error
public function testSalesOrderCreate()
{
$salesOrderService = $this->getKernel()->getContainer()->get('vespolina.order_document');
$salesOrder = $salesOrderService->createOrder('default_b2c');
$salesOrderItem1 = $salesOrderService->createItem($salesOrder);
$productA = $this->getMockForAbstractClass('Vespolina\ProductBundle\Model\Product');
$productB = $this->getMockForAbstractClass('Vespolina\ProductBundle\Model\Product');
{
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.3.2",
"symfony/symfony": "2.1.0-dev",
"symfony/doctrine-bridge": "master-dev",
"twig/extensions": "*",
"doctrine/doctrine-fixtures-bundle": "master-dev",
@inspiran
inspiran / pricing.twig
Created February 7, 2012 23:20
Vespolina pricing declaration based on twig alike syntax
{% pricingSet "packable_product" %}
{% element "packaging_cost" %}
{% element "net_value" %}
{% element "net_value_with_packaging_cost" %}
{% element "tax_amount" %}
{% element "unit_price_with_tax" %}
{% endpricingset %}
{% pricingSet "cart_item" %}
{% element "total_discount" %}
@inspiran
inspiran / gist:1918849
Created February 26, 2012 20:30
Activiti export
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://activiti.org/bpmn20">
<process id="Beb1" name="Review And Approve Activiti Process">
<startEvent id="start" name="Start" activiti:formKey="wf:submitReviewTask"></startEvent>
<userTask id="reviewTask" name="Review Task" activiti:assignee="${bpm_assignee.properties.userName}" activiti:formKey="wf:activitiReviewTask">
<extensionElements>
<activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:s
<?php
/**
* (c) 2011-2012 Vespolina Project http://www.vespolina-project.org
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Vespolina\CartBundle\Pricing;
{
"name": "vespolina/vespolina-sandbox",
"type": "symfony-bundle",
"description": "Vespolina sandbox.",
"keywords": ["shop", "ecommerce", "cart", "item"],
"homepage": "http://vespolina-project.org",
"license": "MIT",
"authors": [
{
"name": "Vespolina Team",
@inspiran
inspiran / SimpleCartPricingProvider.php
Created June 13, 2012 21:19
Vespolina - injectable taxation hints
protected function preparePricingContextForTaxation($pricingContext)
{
//Find out if the tax zone was supplied
$taxZone = $pricingContext->get('taxZone');
if (null == $taxZone) {
//Check if a fulfillment address was explicitly set
$address = $pricingContext->get('fulfillmentAddress');
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for doctrine/mongodb dev-master -> satisfiable by doctrine/mongodb dev-master.
- Installation request for doctrine/mongodb-odm dev-master -> satisfiable by doctrine/mongodb-odm dev-master.
- Installation request for symfony/monolog-bundle dev-master -> satisfiable by symfony/monolog-bundle dev-master.
- doctrine/mongodb 1.0.x-dev requires symfony/console >=2.0,<2.2-dev -> satisfiable by symfony/console v2.1.0-BETA1, symfony/console v2.1.0-BETA2, symfony/symfony v2.1.0-BETA1, symfony/console v2.0.13, symfony/symfony v2.0.13, symfony/console 2.0.4, symfony/console 2.0.5, symfony/console 2.0.6, symfony/console 2.0.7, symfony/symfony 2.0.7, symfony/console v2.1.0, symfony/console v2.1.0-RC2, symfony/symfony v2.0.17, symfony/symfony v2.1.0-RC1, symfony/symfony v2.1.0-RC2, symfony/console v2.0.16, symfony/console v2.0.17, symfony/console v2.1.0-BETA3, symfony/console v2.1.0-BETA4, symfony/c