Wrong Tax calculation in Magento on HHVM - magento

I'm running Magento 1.9.1.0 at HHVM 3.14.4
I added hhvm.enable_zend_sorting = 1 to /etc/hhvm/php.ini file and /etc/hhvm/server.ini, but the tax calculation is actually wrong.
Magento Wrong Tax Calculation
34,90*0,07 = 2,429 and not 2,28 like Magento show it.
Has anyone an idea how I can solve my problem?

I had the same problem.
I fixed it by patching app/code/core/Mage/Sales/etc/config.xml:
diff --git a/app/code/core/Mage/Sales/etc/config.xml b/app/code/core/Mage/Sales/etc/config.xml
index f32ac46..852865d 100644
--- a/app/code/core/Mage/Sales/etc/config.xml
+++ b/app/code/core/Mage/Sales/etc/config.xml
## -1218,7 +1218,7 ##
</subtotal>
<shipping>
<class>sales/quote_address_total_shipping</class>
- <after>subtotal,freeshipping,tax_subtotal</after>
+ <after>subtotal,freeshipping,tax_subtotal,msrp</after>
<before>grand_total</before>
</shipping>
<grand_total>
## -1227,6 +1227,7 ##
</grand_total>
<msrp>
<class>sales/quote_address_total_msrp</class>
+ <before>grand_total</before>
</msrp>
</totals>
<nominal_totals>
You might want to wrap it up as an extension to make it upgrade-proof.
here is an example of how to overwrite core config.xml https://magento.stackexchange.com/questions/10695/how-to-override-config-xml

Related

Custom Sphinx directive gives a pickling error

I am trying to register a custom Sphinx directive on my conf.py, like this:
diff --git a/docs/conf.py b/docs/conf.py
index fda031a72..2d829602d 100644
--- a/docs/conf.py
+++ b/docs/conf.py
## -2,6 +2,10 ## import os
import sys
from configparser import RawConfigParser
+from docutils import nodes
+from docutils.parsers.rst import directives
+from docutils.parsers.rst.directives.admonitions import BaseAdmonition
+
import sphinx_rtd_theme
sys.path.insert(0, os.path.abspath('..'))
## -153,5 +157,18 ## linkcheck_ignore = [
]
+class commercial(nodes.Admonition, nodes.Element):
+ pass
+
+
+class Commercial(BaseAdmonition):
+
+ node_class = commercial
+
+
def setup(app):
app.add_css_file('css/sphinx_prompt_css.css')
+
+ app.add_node(commercial)
+
+ directives.register_directive('commercial', Commercial)
but my make html fails with this error:
Exception occurred:
File "/home/juanlu/Projects/RTD/readthedocs.org/.venv/lib/python3.6/site-packages/sphinx/builders/__init__.py", line 501, in write_doctree
pickle.dump(doctree, f, pickle.HIGHEST_PROTOCOL)
_pickle.PicklingError: Can't pickle <class 'commercial'>: attribute lookup commercial on builtins failed
full traceback: https://pastebin.com/fgHdDpJK
Anybody knows what's going on here?
This isn't possible, see this issue, and this one, and this one, and these docs:
It is important to know that while you can extend Sphinx without leaving your conf.py, if you declare an inherited node right there, you’ll hit an unobvious PickleError. So if something goes wrong, please make sure that you put inherited nodes into a separate Python module.

Typo3/CKEditor: Allow definition list (dl, dt, dd)

this question is driving me crazy. I'm using typo3 (8.7.13) with CKEditor as the RTE. Now I want to allow to use <dl>, <dt> and <dd> in the source code view mode. But every time I leave the source code view those tags become modified to <p>
<dl>, <dt> and <dd> are lsited in the yaml file under
processing:
allowTags:
- dl
- dt
- dd
And within the template constants i set:
styles.content.allowTags := addToList(dd)
styles.content.allowTags := addToList(dt)
styles.content.allowTags := addToList(dl)
What more is necessary?
fins wimmer
Yeah, I finaly found the solution based on this topic.
This needs to be inserted in the yaml config:
editor:
config:
extraAllowedContent:
- dd
- dl
- dt
fin swimmer
I've found a plugin for ckeditor (which not only allows <dl> tags and so forth but also provides custom buttons for the editor) and created a simple wrapper extension to easily integrate that into TYPO3. In case anyone's interested it's on github as rte_ckeditor_dl.
Does this work ?
RTE.default {
allowTags < RTE.default.proc.allowTags
proc {
allowTagsOutside := addToList(dd,dt,dl)
}
}
documentation
Do your own configuration for CKEditor as YAML and add
processing:
# Tags that are allowed in the content in general
allowTags:
- dd
- dl
- dt
## Tags that are allowed outside of paragraphs
allowTagsOutside: [dd, dl, dt]
editor:
config:
allowedContent: true
[..]
processing
allowTags:
- dl
- dt
- dd

My language switcher does not work only from the blog page

I've written my language switcher as below.
It works from / or from /blog/<blog-post> but it does not work from the /blog page even if /en/blog is available.
Japanese | English
Is it bug or should I fix something?
Below is my web site language switcher is available on top-right of the page.
Working (top level page): http://www.socoka.com/
Not working (Blog page): http://www.socoka.com/blog/
In Lektor versions < 2 there are some limitations with regards to the alts. This is working correctly in Lektor 2 which is currently in development only. But you can install it from the git master if you already want to use it.
It can be reproduced by adding the following patch to quickstart project (project name: alt_test)
Tested environment is below.
lektor version:
bc61976a0c7aca3374a40d55f633a83e0686c247
python version: 2.7.10
diff --git a/alt_test.lektorproject b/alt_test.lektorproject
index d53bfea..e3da734 100644
--- a/alt_test.lektorproject
+++ b/alt_test.lektorproject
## -1,2 +1,12 ##
[project]
name = alt_test
+
+[alternatives.jp]
+name = Japanese
+primary = yes
+locale = ja_JP
+
+[alternatives.en]
+name = English
+url_prefix = /en/
+locale = en_US
diff --git a/templates/layout.html b/templates/layout.html
index ed7a449..1a61a9c 100644
--- a/templates/layout.html
+++ b/templates/layout.html
## -17,6 +17,7 ##
<li{% if this.is_child_of(href) %} class="active"{% endif
%}>{{ title }}</li>
{% endfor %}
+ Japanese | English
</ul>
</nav>
</header>

Magmi importing configurable product

Im trying to import products using magmi. I can import simple products. But not able to import configurable products. I tried finding sample csv files to import configurable products. But I couldnt find right one. I know im having problem with my csv file. Can anyone help me to resolve my issue? Here is my csv file.
sku,store,attributeset,type,category,root_category,product_websites,activation_information,color,computer_manufacturers,contrast_ratio,cost,country_of_manufacture,country_orgin,cpu_speed,created_at,custom_design,custom_design_from,custom_design_to,custom_layout_update,description,dimension,enable_googlecheckout,finish,gallery,gender,gift_message_available,harddrive_speed,hardrive,has_options,image,image_label,in_depth,manufacturer,max_resolution,media_gallery,megapixels,memory,meta_description,meta_keyword,meta_title,minimal_price,model,msrp,msrp_display_actual_price_type,msrp_enabled,name,news_from_date,news_to_date,options_container,page_layout,price,processor,ram_size,required_options,response_time,room,screensize,shape,shirt_size,shoe_size,shoe_type,short_description,small_image,small_image_label,special_from_date,special_price,special_to_date,status,tax_class_id,thumbnail,thumbnail_label,updated_at,url_key,url_path,visibility,weight,qty,min_qty,use_config_min_qty,is_qty_decimal,backorders,use_config_backorders,min_sale_qty,use_config_min_sale_qty,max_sale_qty,use_config_max_sale_qty,is_in_stock,notify_stock_qty,use_config_notify_stock_qty,manage_stock,use_config_manage_stock,stock_status_changed_auto,use_config_qty_increments,qty_increments,use_config_enable_qty_inc,enable_qty_increments,is_decimal_divided,links_related_sku,links_related_position,links_crosssell_sku,links_crosssell_position,links_upsell_sku,links_upsell_position,associated_sku,associated_default_qty,associated_position,tier_price_website,tier_price_customer_group,tier_price_qty,tier_price_price,group_price_website,group_price_customer_group,group_price_price,media_attribute_id,media_image,media_lable,media_position,media_is_disabled,custom_option_store,custom_option_type,custom_option_title,custom_option_is_required,custom_option_price,custom_option_sku,custom_option_max_characters,custom_option_sort_order,custom_option_row_title,custom_option_row_price,custom_option_row_sku,custom_option_row_sort,super_products_sku,super_attribute_code,super_attribute_option,super_attribute_price_corr,simples_skus,configurable_attributes
999-Black,,Default,simple,,,base,,Black,,,,,,,4/23/2013 9:29,,,,,test,,1,,,,,,,0,,,,,,,,,,,,,,,Use config,Use config,My IS test-Black,,,Block after Info Column,,122,,,0,,,,,,,,tewst,,,,,,1,0,,,4/23/2013 9:29,my-is-test-black,my-is-test-black.html,1,100,100,0,1,0,0,1,1,1,0,1,1,,1,0,1,0,1,0,1,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
999-Blue,,Default,simple,,,base,,Blue,,,,,,,4/23/2013 9:30,,,,,test,,1,,,,,,,0,,,,,,,,,,,,,,,Use config,Use config,My IS test-Blue,,,Block after Info Column,,122,,,0,,,,,,,,tewst,,,,,,1,0,,,4/23/2013 9:30,my-is-test-blue,my-is-test-blue.html,1,100,100,0,1,0,0,1,1,1,0,1,1,,1,0,1,0,1,0,1,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
999-Brown,,Default,simple,,,base,,Brown,,,,,,,4/23/2013 9:30,,,,,test,,1,,,,,,,0,,,,,,,,,,,,,,,Use config,Use config,My IS test-Brown,,,Block after Info Column,,122,,,0,,,,,,,,tewst,,,,,,1,0,,,4/23/2013 9:30,my-is-test-brown,my-is-test-brown.html,1,100,100,0,1,0,0,1,1,1,0,1,1,,1,0,1,0,1,0,1,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
999-Green,,Default,simple,,,base,,Green,,,,,,,4/23/2013 9:30,,,,,test,,1,,,,,,,0,,,,,,,,,,,,,,,Use config,Use config,My IS test-Green,,,Block after Info Column,,122,,,0,,,,,,,,tewst,,,,,,1,0,,,4/23/2013 9:30,my-is-test-green,my-is-test-green.html,1,100,100,0,1,0,0,1,1,1,0,1,1,,1,0,1,0,1,0,1,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
999,,Default,configurable,Furniture/Living Room,Root Catalog,base,,,,,,,,,4/23/2013 9:29,,,,,test,,1,,,,,,,1,no_selection,,,,,,,,,,,,,,Use config,Use config,My IS test,,,Block after Info Column,,122,,,1,,,,,,,,tewst,no_selection,,,,,1,0,no_selection,,4/23/2013 9:30,my-is-test,my-is-test.html,4,,0,0,1,0,0,1,1,1,0,1,1,,1,0,1,0,1,0,1,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"999-Black,999-Blue,999-Brown,999-Green",color,"Black,Blue,Brown,Green",,"999-Black,999-Blue,999-Brown,999-Green",color
Make sure you have the Configurable Item processor plugin enabled. It's listed under the Itemprocessors section in Magmi.
Also make sure the settings for the Configurable Item processor plugin are as follows:
Perform simples/configurable link set to Yes
auto match simples skus before configurable set to No (since you are specifying the matches in the simples_skus column.
In my case the solution was to edit the file magmi/plugins/base/itemprocessors/configurables/magmi_configurableprocessor.php changing the line:
//if no entry found, create one
if($psaid==NULL)
{
$sql="INSERT INTO `$cpsa` (`product_id`,`attribute_id`,`position`) VALUES (?,?,?)";
//inserting new options
$psaid=$this->insert($sql,array($pid,$attrid,$idx));
}
for
//if no entry found, create one
if($psaid==NULL)
{
$sql="INSERT INTO `$cpsa` (`product_id`,`attribute_id`,`position`) VALUES (:a, :b, :c)";
$data = array(
'a' => $pid,
'b' => $attrid,
'c' =>$idx,
);
//inserting new options
$psaid=$this->insert($sql,$data);
}

Grit commit_diff shows reverse diff

I'm trying to do a very simple thing: Read a diff from a git repo via the ruby gem Grit. I'm creating a file and adding the line "This is me changing the first file". Now I do this to get the diff:
r = Grit::Repo.new("myrepo")
c = r.commits.first
d = r.commit_diff(c.id).first
puts d.first.diff
The output of this is:
--- a/First-File.asciidoc
+++ b/First-File.asciidoc
## -1,2 +1 ##
-This is me changing the first file
See that minus in front of the added line? Why would a commit_diff show in reverse? I know that git reverses the diff if I reverse the commit shas, but this is a Grit library call that only gives the commit diff?
Any clues?
Let me answer that question. The commit shows up in correct form, if you do this insteas:
r = Grit::Repo.new("myrepo")
c = r.commits.first
d = c.diffs.first
puts d.first.diff
Not sure what the difference would be between Commit.diff and Repo.commit_diff.

Resources