Tax calculation in the US per state?

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
jossnaz
Posts: 46
Joined: 22 Jul 2016, 01:19

Tax calculation in the US per state?

Post by jossnaz » 26 Aug 2016, 00:16

i am currently using aimeos 2016.04.3

i read this:

https://aimeos.org/docs/User_Manual/Setup_B2B_shop


now setting in my shop.php

Code: Select all

  'mshop' => array(
    'price' => array(
      'taxflag' => 0
    )
  ),
does not seem to change a thing.

Code: Select all

1	$ 39.95	$ 39.95
Sub-total	$ 39.95
Total	$ 39.95
+ 8.63% VAT	$ 3.45
Total quantity	1 article
e.g. the tax is not added to the total price.

Furthermore: in the US they have a sales tax (not vat tax, but i seem to fail to see how to change that bit). The sales tax actually depends on the US state people do live in.

So:
New york has a different tax rate than say california.

Now to enable the state selection I thought I do this:


https://aimeos.org/docs/Configuration/C ... ess/states


So my shop.php has this:

Code: Select all

'client' => array(
    'html' => array(
      'checkout' => array(
        'standard' => array(
          'address' => array(
            'states' => array(
              'US' => array(
                'AL'=>'ALABAMA',
                'AK'=>'ALASKA',
                'AS'=>'AMERICAN SAMOA',
                'AZ'=>'ARIZONA',
                'AR'=>'ARKANSAS',
                'CA'=>'CALIFORNIA',
                'CO'=>'COLORADO',
                'CT'=>'CONNECTICUT',
                'DE'=>'DELAWARE',
                'DC'=>'DISTRICT OF COLUMBIA',
                'FM'=>'FEDERATED STATES OF MICRONESIA',
                'FL'=>'FLORIDA',
                'GA'=>'GEORGIA',
                'GU'=>'GUAM GU',
                'HI'=>'HAWAII',
                'ID'=>'IDAHO',
                'IL'=>'ILLINOIS',
                'IN'=>'INDIANA',
                'IA'=>'IOWA',
                'KS'=>'KANSAS',
                'KY'=>'KENTUCKY',
                'LA'=>'LOUISIANA',
                'ME'=>'MAINE',
                'MH'=>'MARSHALL ISLANDS',
                'MD'=>'MARYLAND',
                'MA'=>'MASSACHUSETTS',
                'MI'=>'MICHIGAN',
                'MN'=>'MINNESOTA',
                'MS'=>'MISSISSIPPI',
                'MO'=>'MISSOURI',
                'MT'=>'MONTANA',
                'NE'=>'NEBRASKA',
                'NV'=>'NEVADA',
                'NH'=>'NEW HAMPSHIRE',
                'NJ'=>'NEW JERSEY',
                'NM'=>'NEW MEXICO',
                'NY'=>'NEW YORK',
                'NC'=>'NORTH CAROLINA',
                'ND'=>'NORTH DAKOTA',
                'MP'=>'NORTHERN MARIANA ISLANDS',
                'OH'=>'OHIO',
                'OK'=>'OKLAHOMA',
                'OR'=>'OREGON',
                'PW'=>'PALAU',
                'PA'=>'PENNSYLVANIA',
                'PR'=>'PUERTO RICO',
                'RI'=>'RHODE ISLAND',
                'SC'=>'SOUTH CAROLINA',
                'SD'=>'SOUTH DAKOTA',
                'TN'=>'TENNESSEE',
                'TX'=>'TEXAS',
                'UT'=>'UTAH',
                'VT'=>'VERMONT',
                'VI'=>'VIRGIN ISLANDS',
                'VA'=>'VIRGINIA',
                'WA'=>'WASHINGTON',
                'WV'=>'WEST VIRGINIA',
                'WI'=>'WISCONSIN',
                'WY'=>'WYOMING',
                'AE'=>'ARMED FORCES AFRICA \ CANADA \ EUROPE \ MIDDLE EAST',
                'AA'=>'ARMED FORCES AMERICA (EXCEPT CANADA)',
                'AP'=>'ARMED FORCES PACIFIC'
              )
            ),
          )
        ),
      ),
...
but the state selection does not surface in the checkout process.


So my question is: how should I implement a salestax that depends on each single state of the US? that is, the tax is hidden from the price, e.g. the price entered in the backend is the net price. Once the client reaches the payment process and enters his state, he will get shown the new price, with sales tax included that depends on the state he lives in. Further thing:
The salestax includes the shipping cost.

So lets say he buys a product for 90 dollars. Then he chooses a shipping for 10 dollars. He livs in NY so he has, lets just assume, 10 % sales tax

That will show him a subtotal and total of 110 usd of price that he will have to pay saying "sales tax".
If he lives in california he pays 5% sales tax, so a total of 105 usd will be presented.

How can i do that?

If he lives outside of the US, he gets no tax added.

User avatar
aimeos
Administrator
Posts: 7835
Joined: 01 Jan 1970, 00:00

Re: Tax calculation in the US per state?

Post by aimeos » 26 Aug 2016, 16:55

Can you please update to "~2016.07" first? We've fixed the problems you've reported before in the latest stable versions, so that should work as expected.

The tax output in the basket and the checkout process is rendered here:
https://github.com/aimeos/ai-client-htm ... t.php#L356
Maybe this helps you to find out more why it's not behaving like you expect.

Your states configuration seems to be OK but did you also configured the countries?
https://aimeos.org/docs/Laravel/Configu ... ons_states

Regarding the sales tax: Create a basket plugin that sets the tax rate of the price items of the products and services to the tax rate of the state you get from the billing/payment address. The rest of the calculation should be done automatically. We would love to add this to the Aimeos core, so if you create a pull request on Github, we will improve it together and merge it afterwards.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

jossnaz
Posts: 46
Joined: 22 Jul 2016, 01:19

Re: Tax calculation in the US per state?

Post by jossnaz » 26 Aug 2016, 19:57

i am now again back on 2016.07

I still have no possibility to select the state.

My shop.php is this now:

Code: Select all

<?php

return array(
//
//	'routes' => array(
//		# 'login' => array('middleware' => ['web']),
//		# 'admin' => array('middleware' => ['web', 'auth']),
//		# 'account' => array('middleware' => ['web', 'auth']),
//		# 'default' => array('middleware' => ['web']),
//		# 'confirm' => array('middleware' => ['web']),
//		# 'update' => array(),
//	),

  'routes' => array(
    'login' => array(),
    'admin' => array('middleware' => array('auth')),
    'account' => array('middleware' => array('auth')),
    'default' => array(),
    'confirm' => array(),
    'update' => array(),
  ),

  'page' => array(
    # 'account-index' => array( 'account/history','account/favorite','account/watch','basket/mini','catalog/session' ),
    # 'basket-index' => array( 'basket/standard','basket/related' ),
    # 'catalog-count' => array( 'catalog/count' ),
    # 'catalog-detail' => array( 'basket/mini','catalog/stage','catalog/detail','catalog/session' ),
    # 'catalog-list' => array( 'basket/mini','catalog/filter','catalog/stage','catalog/lists' ),
    # 'catalog-stock' => array( 'catalog/stock' ),
    # 'catalog-suggest' => array( 'catalog/suggest' ),
    # 'checkout-confirm' => array( 'checkout/confirm' ),
    # 'checkout-index' => array( 'checkout/standard' ),
    # 'checkout-update' => array( 'checkout/update'),
    'FibrFixSelect' => array('basket/mini', 'catalog/filter', 'catalog/stage', 'catalog/lists'),
  ),

  'resource' => array(
    'db' => array(
      # 'adapter' => 'mysql',
      # 'host' => env('DB_HOST', 'localhost'),
      # 'port' => env('DB_PORT', ''),
      # 'database' => env('DB_DATABASE', 'laravel'),
      # 'username' => env('DB_USERNAME', 'root'),
      # 'password' => env('DB_PASSWORD', ''),
    ),
  ),
  'client' => array(
    'html' => array(
      'checkout' => array(
        'standard' => array(
          'address' => array(
              'countries' => array(
                'AD', // Andorra
                'AE', // United Arab Emirates
                'AF', // Afghanistan
                'AG', // Antigua and Barbuda
                'AI', // Anguilla
                'AL', // Albania
                'AM', // Armenia
                'AO', // Angola
                'AQ', // Antarctica
                'AR', // Argentina
                'AS', // American Samoa
                'AT', // Austria
                'AU', // Australia
                'AW', // Aruba
                'AX', // Åland Islands
                'AZ', // Azerbaijan
                'BA', // Bosnia and Herzegovina
                'BB', // Barbados
                'BD', // Bangladesh
                'BE', // Belgium
                'BF', // Burkina Faso
                'BG', // Bulgaria
                'BH', // Bahrain
                'BI', // Burundi
                'BJ', // Benin
                'BL', // Saint Barthélemy
                'BM', // Bermuda
                'BN', // Brunei Darussalam
                'BO', // Bolivia, Plurinational State of
                'BQ', // Bonaire, Sint Eustatius and Saba
                'BR', // Brazil
                'BS', // Bahamas
                'BT', // Bhutan
                'BV', // Bouvet Island
                'BW', // Botswana
                'BY', // Belarus
                'BZ', // Belize
                'CA', // Canada
                'CC', // Cocos (Keeling) Islands
                'CD', // Congo, the Democratic Republic of the
                'CF', // Central African Republic
                'CG', // Congo
                'CH', // Switzerland
                'CI', // Côte d'Ivoire
                'CK', // Cook Islands
                'CL', // Chile
                'CM', // Cameroon
                'CN', // China
                'CO', // Colombia
                'CR', // Costa Rica
                'CU', // Cuba
                'CV', // Cape Verde
                'CW', // Curaçao
                'CX', // Christmas Island
                'CY', // Cyprus
                'CZ', // Czech Republic
                'DE', // Germany
                'DJ', // Djibouti
                'DK', // Denmark
                'DM', // Dominica
                'DO', // Dominican Republic
                'DZ', // Algeria
                'EC', // Ecuador
                'EE', // Estonia
                'EG', // Egypt
                'EH', // Western Sahara
                'ER', // Eritrea
                'ES', // Spain
                'ET', // Ethiopia
                'FI', // Finland
                'FJ', // Fiji
                'FK', // Falkland Islands (Malvinas)
                'FM', // Micronesia, Federated States of
                'FO', // Faroe Islands
                'FR', // France
                'GA', // Gabon
                'GB', // United Kingdom
                'GD', // Grenada
                'GE', // Georgia
                'GF', // French Guiana
                'GG', // Guernsey
                'GH', // Ghana
                'GI', // Gibraltar
                'GL', // Greenland
                'GM', // Gambia
                'GN', // Guinea
                'GP', // Guadeloupe
                'GQ', // Equatorial Guinea
                'GR', // Greece
                'GS', // South Georgia and the South Sandwich Islands
                'GT', // Guatemala
                'GU', // Guam
                'GW', // Guinea-Bissau
                'GY', // Guyana
                'HK', // Hong Kong
                'HM', // Heard Island and McDonald Islands
                'HN', // Honduras
                'HR', // Croatia
                'HT', // Haiti
                'HU', // Hungary
                'ID', // Indonesia
                'IE', // Ireland
                'IL', // Israel
                'IM', // Isle of Man
                'IN', // India
                'IO', // British Indian Ocean Territory
                'IQ', // Iraq
                'IR', // Iran, Islamic Republic of
                'IS', // Iceland
                'IT', // Italy
                'JE', // Jersey
                'JM', // Jamaica
                'JO', // Jordan
                'JP', // Japan
                'KE', // Kenya
                'KG', // Kyrgyzstan
                'KH', // Cambodia
                'KI', // Kiribati
                'KM', // Comoros
                'KN', // Saint Kitts and Nevis
                'KP', // Korea, Democratic People's Republic of
                'KR', // Korea, Republic of
                'KW', // Kuwait
                'KY', // Cayman Islands
                'KZ', // Kazakhstan
                'LA', // Lao People's Democratic Republic
                'LB', // Lebanon
                'LC', // Saint Lucia
                'LI', // Liechtenstein
                'LK', // Sri Lanka
                'LR', // Liberia
                'LS', // Lesotho
                'LT', // Lithuania
                'LU', // Luxembourg
                'LV', // Latvia
                'LY', // Libya
                'MA', // Morocco
                'MC', // Monaco
                'MD', // Moldova, Republic of
                'ME', // Montenegro
                'MF', // Saint Martin (French part)
                'MG', // Madagascar
                'MH', // Marshall Islands
                'MK', // Macedonia
                'ML', // Mali
                'MM', // Myanmar
                'MN', // Mongolia
                'MO', // Macao
                'MP', // Northern Mariana Islands
                'MQ', // Martinique
                'MR', // Mauritania
                'MS', // Montserrat
                'MT', // Malta
                'MU', // Mauritius
                'MV', // Maldives
                'MW', // Malawi
                'MX', // Mexico
                'MY', // Malaysia
                'MZ', // Mozambique
                'NA', // Namibia
                'NC', // New Caledonia
                'NE', // Niger
                'NF', // Norfolk Island
                'NG', // Nigeria
                'NI', // Nicaragua
                'NL', // Netherlands
                'NO', // Norway
                'NP', // Nepal
                'NR', // Nauru
                'NU', // Niue
                'NZ', // New Zealand
                'OM', // Oman
                'PA', // Panama
                'PE', // Peru
                'PF', // French Polynesia
                'PG', // Papua New Guinea
                'PH', // Philippines
                'PK', // Pakistan
                'PL', // Poland
                'PM', // Saint Pierre and Miquelon
                'PN', // Pitcairn
                'PR', // Puerto Rico
                'PS', // Palestine, State of
                'PT', // Portugal
                'PW', // Palau
                'PY', // Paraguay
                'QA', // Qatar
                'RE', // Réunion
                'RO', // Romania
                'RS', // Serbia
                'RU', // Russian Federation
                'RW', // Rwanda
                'SA', // Saudi Arabia
                'SB', // Solomon Islands
                'SC', // Seychelles
                'SD', // Sudan
                'SE', // Sweden
                'SG', // Singapore
                'SH', // Saint Helena, Ascension and Tristan da Cunha
                'SI', // Slovenia
                'SJ', // Svalbard and Jan Mayen
                'SK', // Slovakia
                'SL', // Sierra Leone
                'SM', // San Marino
                'SN', // Senegal
                'SO', // Somalia
                'SR', // Suriname
                'SS', // South Sudan
                'ST', // Sao Tome and Principe
                'SV', // El Salvador
                'SX', // Sint Maarten (Dutch part)
                'SY', // Syrian Arab Republic
                'SZ', // Swaziland
                'TC', // Turks and Caicos Islands
                'TD', // Chad
                'TF', // French Southern Territories
                'TG', // Togo
                'TH', // Thailand
                'TJ', // Tajikistan
                'TK', // Tokelau
                'TL', // Timor-Leste
                'TM', // Turkmenistan
                'TN', // Tunisia
                'TO', // Tonga
                'TR', // Turkey
                'TT', // Trinidad and Tobago
                'TV', // Tuvalu
                'TW', // Taiwan
                'TZ', // Tanzania, United Republic of
                'UA', // Ukraine
                'UG', // Uganda
                'UM', // United States Minor Outlying Islands
                'US', // United States
                'UY', // Uruguay
                'UZ', // Uzbekistan
                'VA', // Vatican City State (Holy See)
                'VC', // Saint Vincent and the Grenadines
                'VE', // Venezuela, Bolivarian Republic of
                'VG', // Virgin Islands, British
                'VI', // Virgin Islands, U.S.
                'VN', // Viet Nam
                'VU', // Vanuatu
                'WF', // Wallis and Futuna
                'WS', // Samoa
                'YE', // Yemen
                'YT', // Mayotte
                'ZA', // South Africa
                'ZM', // Zambia
                'ZW', // Zimbabwe
              ),
            'states' => array(
              'US' => array(
                'AL'=>'ALABAMA',
                'AK'=>'ALASKA',
                'AS'=>'AMERICAN SAMOA',
                'AZ'=>'ARIZONA',
                'AR'=>'ARKANSAS',
                'CA'=>'CALIFORNIA',
                'CO'=>'COLORADO',
                'CT'=>'CONNECTICUT',
                'DE'=>'DELAWARE',
                'DC'=>'DISTRICT OF COLUMBIA',
                'FM'=>'FEDERATED STATES OF MICRONESIA',
                'FL'=>'FLORIDA',
                'GA'=>'GEORGIA',
                'GU'=>'GUAM GU',
                'HI'=>'HAWAII',
                'ID'=>'IDAHO',
                'IL'=>'ILLINOIS',
                'IN'=>'INDIANA',
                'IA'=>'IOWA',
                'KS'=>'KANSAS',
                'KY'=>'KENTUCKY',
                'LA'=>'LOUISIANA',
                'ME'=>'MAINE',
                'MH'=>'MARSHALL ISLANDS',
                'MD'=>'MARYLAND',
                'MA'=>'MASSACHUSETTS',
                'MI'=>'MICHIGAN',
                'MN'=>'MINNESOTA',
                'MS'=>'MISSISSIPPI',
                'MO'=>'MISSOURI',
                'MT'=>'MONTANA',
                'NE'=>'NEBRASKA',
                'NV'=>'NEVADA',
                'NH'=>'NEW HAMPSHIRE',
                'NJ'=>'NEW JERSEY',
                'NM'=>'NEW MEXICO',
                'NY'=>'NEW YORK',
                'NC'=>'NORTH CAROLINA',
                'ND'=>'NORTH DAKOTA',
                'MP'=>'NORTHERN MARIANA ISLANDS',
                'OH'=>'OHIO',
                'OK'=>'OKLAHOMA',
                'OR'=>'OREGON',
                'PW'=>'PALAU',
                'PA'=>'PENNSYLVANIA',
                'PR'=>'PUERTO RICO',
                'RI'=>'RHODE ISLAND',
                'SC'=>'SOUTH CAROLINA',
                'SD'=>'SOUTH DAKOTA',
                'TN'=>'TENNESSEE',
                'TX'=>'TEXAS',
                'UT'=>'UTAH',
                'VT'=>'VERMONT',
                'VI'=>'VIRGIN ISLANDS',
                'VA'=>'VIRGINIA',
                'WA'=>'WASHINGTON',
                'WV'=>'WEST VIRGINIA',
                'WI'=>'WISCONSIN',
                'WY'=>'WYOMING',
                'AE'=>'ARMED FORCES AFRICA \ CANADA \ EUROPE \ MIDDLE EAST',
                'AA'=>'ARMED FORCES AMERICA (EXCEPT CANADA)',
                'AP'=>'ARMED FORCES PACIFIC'
              )
            ),
          )
        ),
      ),
      'basket' => array(
        'standard' => array(
          'standard' => array(
            'template-body' =>
              __DIR__ . '/../resources/views/cmc/aimeos/basket/cmc_basket_body.php'
          )
        )

      ),
      'common' => array(
        'content' => array(
          'baseurl' => 'http://myapp.local/',
//          'baseurl' => '/',
        ),
        'template' => array(
          'baseurl' => public_path('packages/aimeos/shop/themes/elegance'),
        ),
      ),
      'email' => array(
        'from-email' => 'myname+testaimeos@gmail.com',
        'from-name' => 'Lukastest Aimeos',
      ),
    ),
  ),
  'controller' => array(
    'jobs' => array(
      'product' => array(
        'import' => array(
          'csv' => array(
            'location' => __DIR__ . '/../database/csvimport/',


            'mapping' => array(
              'item' => array(
                0 => 'product.code', // e.g. unique EAN code
                1 => 'product.label', // UTF-8 encoded text, also used as product name
                2 => 'product.type', // type of the product, e.g. "default" or "selection"
                3 => 'product.status', // enabled (1) or disabled (0)
              ),
              'text' => array(
                4 => 'text.type', // e.g. "short" for short description
                5 => 'text.content', // UTF-8 encoded text
                6 => 'text.type', // e.g. "long" for long description
                7 => 'text.content', // UTF-8 encoded text
              ),
              'media' => array(
                8 => 'media.url', // relative URL of the product image on the server
              ),
              'price' => array(
                9 => 'price.quantity', // the quantity the price is valid from (for block pricing)
                10 => 'price.value', // price with decimals separated by a dot, no thousand separator
                11 => 'price.taxrate', // tax rate with decimals separated by a dot
              ),
              'property' => array(
                14 => 'product.property.value', //
                15 => 'product.property.type', // color code
                16 => 'product.property.value', //
                17 => 'product.property.type', // sku code
                60 => 'product.property.value', //
                61 => 'product.property.type', // manufacturer color
              ),
              'catalog' => array(
                13 => 'catalog.list.type', // standard
                12 => 'catalog.code', // manufacturer
                18 => 'catalog.list.type', // decade of creation
                19 => 'catalog.code', // 20s
                20 => 'catalog.list.type', //
                21 => 'catalog.code', // 30s
                22 => 'catalog.list.type', //
                23 => 'catalog.code', // 40s
                24 => 'catalog.list.type', //
                25 => 'catalog.code', // 50s
                26 => 'catalog.list.type', //
                27 => 'catalog.code', // 60s
                28 => 'catalog.list.type', //
                29 => 'catalog.code', // 70s
                30 => 'catalog.list.type', //
                31 => 'catalog.code', // 80s
                32 => 'catalog.list.type', //
                33 => 'catalog.code', // 90s
                34 => 'catalog.list.type', //
                35 => 'catalog.code', // 2000s
                36 => 'catalog.list.type', //
                37 => 'catalog.code', // 2010s
                38 => 'catalog.list.type', // color group
                39 => 'catalog.code', // reds just as an example,this might not be red
                40 => 'catalog.list.type', //
                41 => 'catalog.code', //
                42 => 'catalog.list.type',
                43 => 'catalog.code', //
                44 => 'catalog.list.type',
                45 => 'catalog.code', //
                46 => 'catalog.list.type',
                47 => 'catalog.code', //
                48 => 'catalog.list.type',
                49 => 'catalog.code', //
                50 => 'catalog.list.type',
                51 => 'catalog.code', //
                52 => 'catalog.list.type',
                53 => 'catalog.code', //
                54 => 'catalog.list.type',
                55 => 'catalog.code', // product group
              ),

              'stock' => array(
                56 => 'product.stock.stocklevel',
                57 => 'product.stock.warehouse',
                58 => 'product.stock.warehouseid',
                59 => 'product.stock.dateback',
              ),
//              'attribute' => array(
//                43 => 'attribute.type', //
//                44 => 'attribute.code', // blues
//              ),
//              'attribute' => array(
//                45 => 'attribute.type', //
//                46 => 'attribute.code', // greys
//              ),
//              'attribute' => array(
//                47 => 'attribute.type', //
//                48 => 'attribute.code', // whites
//              ),
//              'attribute' => array(
//                49 => 'attribute.type', //
//                50 => 'attribute.code', // browns
//              ),
//              'attribute' => array(
//                51 => 'attribute.type', //
//                52 => 'attribute.code', // whites
//              ),
//              'attribute' => array(
//                53 => 'attribute.type', //
//                54 => 'attribute.code', // blacks
//              ),
//              'product' => array(
//                38 => 'product.code', // e.g. EAN code of another product
//                39 => 'product.list.type', // e.g. "suggestion" for suggested product
//              ),
//              'property' => array(
//                40 => 'product.property.value', // arbitrary value for the corresponding type
//                41 => 'product.property.type', // e.g. "package-weight"
//              ),
//              'catalog' => array(
//                42 => 'catalog.code', // e.g. Unique category code
//                43 => 'catalog.list.type', // e.g. "promotion" for top seller products
//              ),
            )

          )
        )
      )
    )
  ),

  'i18n' => array(),

  'mshop' => array(
    'price' => array(
      'taxflag' => 0
    )
  ),

  'madmin' => array(
    'cache' => array(
      'manager' => array(
        'name' => 'None',
      ),
    ),
  ),

);
looks like this:

http://imageshack.com/i/pm8zi6Exp


I need to be able to select the state before i can start writing plugins i fear

User avatar
aimeos
Administrator
Posts: 7835
Joined: 01 Jan 1970, 00:00

Re: Tax calculation in the US per state?

Post by aimeos » 27 Aug 2016, 09:48

You have to add "order.base.address.state" to the list of mandatory input fields (and "order.base.address.countryid" as well):
https://aimeos.org/docs/Configuration/C ... /mandatory
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

jossnaz
Posts: 46
Joined: 22 Jul 2016, 01:19

Re: Tax calculation in the US per state?

Post by jossnaz » 27 Aug 2016, 21:53

i actually have tried that already and removed the code again when it didn't work.

Here is the example shop.php with required fields state and countryid

still no state select

Code: Select all

<?php

return array(
//
//	'routes' => array(
//		# 'login' => array('middleware' => ['web']),
//		# 'admin' => array('middleware' => ['web', 'auth']),
//		# 'account' => array('middleware' => ['web', 'auth']),
//		# 'default' => array('middleware' => ['web']),
//		# 'confirm' => array('middleware' => ['web']),
//		# 'update' => array(),
//	),

  'routes' => array(
    'login' => array(),
    'admin' => array('middleware' => array('auth')),
    'account' => array('middleware' => array('auth')),
    'default' => array(),
    'confirm' => array(),
    'update' => array(),
  ),

  'page' => array(
    # 'account-index' => array( 'account/history','account/favorite','account/watch','basket/mini','catalog/session' ),
    # 'basket-index' => array( 'basket/standard','basket/related' ),
    # 'catalog-count' => array( 'catalog/count' ),
    # 'catalog-detail' => array( 'basket/mini','catalog/stage','catalog/detail','catalog/session' ),
    # 'catalog-list' => array( 'basket/mini','catalog/filter','catalog/stage','catalog/lists' ),
    # 'catalog-stock' => array( 'catalog/stock' ),
    # 'catalog-suggest' => array( 'catalog/suggest' ),
    # 'checkout-confirm' => array( 'checkout/confirm' ),
    # 'checkout-index' => array( 'checkout/standard' ),
    # 'checkout-update' => array( 'checkout/update'),
    'FibrFixSelect' => array('basket/mini', 'catalog/filter', 'catalog/stage', 'catalog/lists'),
  ),

  'resource' => array(
    'db' => array(
      # 'adapter' => 'mysql',
      # 'host' => env('DB_HOST', 'localhost'),
      # 'port' => env('DB_PORT', ''),
      # 'database' => env('DB_DATABASE', 'laravel'),
      # 'username' => env('DB_USERNAME', 'root'),
      # 'password' => env('DB_PASSWORD', ''),
    ),
  ),
  'client' => array(
    'html' => array(
      'checkout' => array(
        'standard' => array(
          'address' => array(
            'billing' => array(
              'mandatory' => array(
                'order.base.address.salutation',
                'order.base.address.firstname',
                'order.base.address.lastname',
                'order.base.address.address1',
                'order.base.address.postal',
                'order.base.address.city',
                'order.base.address.languageid',
                'order.base.address.email',
                'order.base.address.countryid',
                'order.base.address.state',
              ),
            ),
            'countries' => array(
              'AD', // Andorra
              'AE', // United Arab Emirates
              'AF', // Afghanistan
              'AG', // Antigua and Barbuda
              'AI', // Anguilla
              'AL', // Albania
              'AM', // Armenia
              'AO', // Angola
              'AQ', // Antarctica
              'AR', // Argentina
              'AS', // American Samoa
              'AT', // Austria
              'AU', // Australia
              'AW', // Aruba
              'AX', // Åland Islands
              'AZ', // Azerbaijan
              'BA', // Bosnia and Herzegovina
              'BB', // Barbados
              'BD', // Bangladesh
              'BE', // Belgium
              'BF', // Burkina Faso
              'BG', // Bulgaria
              'BH', // Bahrain
              'BI', // Burundi
              'BJ', // Benin
              'BL', // Saint Barthélemy
              'BM', // Bermuda
              'BN', // Brunei Darussalam
              'BO', // Bolivia, Plurinational State of
              'BQ', // Bonaire, Sint Eustatius and Saba
              'BR', // Brazil
              'BS', // Bahamas
              'BT', // Bhutan
              'BV', // Bouvet Island
              'BW', // Botswana
              'BY', // Belarus
              'BZ', // Belize
              'CA', // Canada
              'CC', // Cocos (Keeling) Islands
              'CD', // Congo, the Democratic Republic of the
              'CF', // Central African Republic
              'CG', // Congo
              'CH', // Switzerland
              'CI', // Côte d'Ivoire
              'CK', // Cook Islands
              'CL', // Chile
              'CM', // Cameroon
              'CN', // China
              'CO', // Colombia
              'CR', // Costa Rica
              'CU', // Cuba
              'CV', // Cape Verde
              'CW', // Curaçao
              'CX', // Christmas Island
              'CY', // Cyprus
              'CZ', // Czech Republic
              'DE', // Germany
              'DJ', // Djibouti
              'DK', // Denmark
              'DM', // Dominica
              'DO', // Dominican Republic
              'DZ', // Algeria
              'EC', // Ecuador
              'EE', // Estonia
              'EG', // Egypt
              'EH', // Western Sahara
              'ER', // Eritrea
              'ES', // Spain
              'ET', // Ethiopia
              'FI', // Finland
              'FJ', // Fiji
              'FK', // Falkland Islands (Malvinas)
              'FM', // Micronesia, Federated States of
              'FO', // Faroe Islands
              'FR', // France
              'GA', // Gabon
              'GB', // United Kingdom
              'GD', // Grenada
              'GE', // Georgia
              'GF', // French Guiana
              'GG', // Guernsey
              'GH', // Ghana
              'GI', // Gibraltar
              'GL', // Greenland
              'GM', // Gambia
              'GN', // Guinea
              'GP', // Guadeloupe
              'GQ', // Equatorial Guinea
              'GR', // Greece
              'GS', // South Georgia and the South Sandwich Islands
              'GT', // Guatemala
              'GU', // Guam
              'GW', // Guinea-Bissau
              'GY', // Guyana
              'HK', // Hong Kong
              'HM', // Heard Island and McDonald Islands
              'HN', // Honduras
              'HR', // Croatia
              'HT', // Haiti
              'HU', // Hungary
              'ID', // Indonesia
              'IE', // Ireland
              'IL', // Israel
              'IM', // Isle of Man
              'IN', // India
              'IO', // British Indian Ocean Territory
              'IQ', // Iraq
              'IR', // Iran, Islamic Republic of
              'IS', // Iceland
              'IT', // Italy
              'JE', // Jersey
              'JM', // Jamaica
              'JO', // Jordan
              'JP', // Japan
              'KE', // Kenya
              'KG', // Kyrgyzstan
              'KH', // Cambodia
              'KI', // Kiribati
              'KM', // Comoros
              'KN', // Saint Kitts and Nevis
              'KP', // Korea, Democratic People's Republic of
              'KR', // Korea, Republic of
              'KW', // Kuwait
              'KY', // Cayman Islands
              'KZ', // Kazakhstan
              'LA', // Lao People's Democratic Republic
              'LB', // Lebanon
              'LC', // Saint Lucia
              'LI', // Liechtenstein
              'LK', // Sri Lanka
              'LR', // Liberia
              'LS', // Lesotho
              'LT', // Lithuania
              'LU', // Luxembourg
              'LV', // Latvia
              'LY', // Libya
              'MA', // Morocco
              'MC', // Monaco
              'MD', // Moldova, Republic of
              'ME', // Montenegro
              'MF', // Saint Martin (French part)
              'MG', // Madagascar
              'MH', // Marshall Islands
              'MK', // Macedonia
              'ML', // Mali
              'MM', // Myanmar
              'MN', // Mongolia
              'MO', // Macao
              'MP', // Northern Mariana Islands
              'MQ', // Martinique
              'MR', // Mauritania
              'MS', // Montserrat
              'MT', // Malta
              'MU', // Mauritius
              'MV', // Maldives
              'MW', // Malawi
              'MX', // Mexico
              'MY', // Malaysia
              'MZ', // Mozambique
              'NA', // Namibia
              'NC', // New Caledonia
              'NE', // Niger
              'NF', // Norfolk Island
              'NG', // Nigeria
              'NI', // Nicaragua
              'NL', // Netherlands
              'NO', // Norway
              'NP', // Nepal
              'NR', // Nauru
              'NU', // Niue
              'NZ', // New Zealand
              'OM', // Oman
              'PA', // Panama
              'PE', // Peru
              'PF', // French Polynesia
              'PG', // Papua New Guinea
              'PH', // Philippines
              'PK', // Pakistan
              'PL', // Poland
              'PM', // Saint Pierre and Miquelon
              'PN', // Pitcairn
              'PR', // Puerto Rico
              'PS', // Palestine, State of
              'PT', // Portugal
              'PW', // Palau
              'PY', // Paraguay
              'QA', // Qatar
              'RE', // Réunion
              'RO', // Romania
              'RS', // Serbia
              'RU', // Russian Federation
              'RW', // Rwanda
              'SA', // Saudi Arabia
              'SB', // Solomon Islands
              'SC', // Seychelles
              'SD', // Sudan
              'SE', // Sweden
              'SG', // Singapore
              'SH', // Saint Helena, Ascension and Tristan da Cunha
              'SI', // Slovenia
              'SJ', // Svalbard and Jan Mayen
              'SK', // Slovakia
              'SL', // Sierra Leone
              'SM', // San Marino
              'SN', // Senegal
              'SO', // Somalia
              'SR', // Suriname
              'SS', // South Sudan
              'ST', // Sao Tome and Principe
              'SV', // El Salvador
              'SX', // Sint Maarten (Dutch part)
              'SY', // Syrian Arab Republic
              'SZ', // Swaziland
              'TC', // Turks and Caicos Islands
              'TD', // Chad
              'TF', // French Southern Territories
              'TG', // Togo
              'TH', // Thailand
              'TJ', // Tajikistan
              'TK', // Tokelau
              'TL', // Timor-Leste
              'TM', // Turkmenistan
              'TN', // Tunisia
              'TO', // Tonga
              'TR', // Turkey
              'TT', // Trinidad and Tobago
              'TV', // Tuvalu
              'TW', // Taiwan
              'TZ', // Tanzania, United Republic of
              'UA', // Ukraine
              'UG', // Uganda
              'UM', // United States Minor Outlying Islands
              'US', // United States
              'UY', // Uruguay
              'UZ', // Uzbekistan
              'VA', // Vatican City State (Holy See)
              'VC', // Saint Vincent and the Grenadines
              'VE', // Venezuela, Bolivarian Republic of
              'VG', // Virgin Islands, British
              'VI', // Virgin Islands, U.S.
              'VN', // Viet Nam
              'VU', // Vanuatu
              'WF', // Wallis and Futuna
              'WS', // Samoa
              'YE', // Yemen
              'YT', // Mayotte
              'ZA', // South Africa
              'ZM', // Zambia
              'ZW', // Zimbabwe
            ),
            'states' => array(
              'US' => array(
                'AL' => 'ALABAMA',
                'AK' => 'ALASKA',
                'AS' => 'AMERICAN SAMOA',
                'AZ' => 'ARIZONA',
                'AR' => 'ARKANSAS',
                'CA' => 'CALIFORNIA',
                'CO' => 'COLORADO',
                'CT' => 'CONNECTICUT',
                'DE' => 'DELAWARE',
                'DC' => 'DISTRICT OF COLUMBIA',
                'FM' => 'FEDERATED STATES OF MICRONESIA',
                'FL' => 'FLORIDA',
                'GA' => 'GEORGIA',
                'GU' => 'GUAM GU',
                'HI' => 'HAWAII',
                'ID' => 'IDAHO',
                'IL' => 'ILLINOIS',
                'IN' => 'INDIANA',
                'IA' => 'IOWA',
                'KS' => 'KANSAS',
                'KY' => 'KENTUCKY',
                'LA' => 'LOUISIANA',
                'ME' => 'MAINE',
                'MH' => 'MARSHALL ISLANDS',
                'MD' => 'MARYLAND',
                'MA' => 'MASSACHUSETTS',
                'MI' => 'MICHIGAN',
                'MN' => 'MINNESOTA',
                'MS' => 'MISSISSIPPI',
                'MO' => 'MISSOURI',
                'MT' => 'MONTANA',
                'NE' => 'NEBRASKA',
                'NV' => 'NEVADA',
                'NH' => 'NEW HAMPSHIRE',
                'NJ' => 'NEW JERSEY',
                'NM' => 'NEW MEXICO',
                'NY' => 'NEW YORK',
                'NC' => 'NORTH CAROLINA',
                'ND' => 'NORTH DAKOTA',
                'MP' => 'NORTHERN MARIANA ISLANDS',
                'OH' => 'OHIO',
                'OK' => 'OKLAHOMA',
                'OR' => 'OREGON',
                'PW' => 'PALAU',
                'PA' => 'PENNSYLVANIA',
                'PR' => 'PUERTO RICO',
                'RI' => 'RHODE ISLAND',
                'SC' => 'SOUTH CAROLINA',
                'SD' => 'SOUTH DAKOTA',
                'TN' => 'TENNESSEE',
                'TX' => 'TEXAS',
                'UT' => 'UTAH',
                'VT' => 'VERMONT',
                'VI' => 'VIRGIN ISLANDS',
                'VA' => 'VIRGINIA',
                'WA' => 'WASHINGTON',
                'WV' => 'WEST VIRGINIA',
                'WI' => 'WISCONSIN',
                'WY' => 'WYOMING',
                'AE' => 'ARMED FORCES AFRICA \ CANADA \ EUROPE \ MIDDLE EAST',
                'AA' => 'ARMED FORCES AMERICA (EXCEPT CANADA)',
                'AP' => 'ARMED FORCES PACIFIC'
              )
            ),
          )
        ),
      ),
      'basket' => array(
        'standard' => array(
          'standard' => array(
            'template-body' =>
              __DIR__ . '/../resources/views/cmc/aimeos/basket/cmc_basket_body.php'
          )
        )

      ),
      'common' => array(
        'content' => array(
          'baseurl' => 'http://ffix.local/',
//          'baseurl' => '/',
        ),
        'template' => array(
          'baseurl' => public_path('packages/aimeos/shop/themes/elegance'),
        ),
      ),
      'email' => array(
        'from-email' => 'bippo@gmail.com',
        'from-name' => 'Lukastest Aimeos',
      ),
    ),
  ),
  'controller' => array(
    'jobs' => array(
      'product' => array(
        'import' => array(
          'csv' => array(
            'location' => __DIR__ . '/../database/csvimport/',


            'mapping' => array(
              'item' => array(
                0 => 'product.code', // e.g. unique EAN code
                1 => 'product.label', // UTF-8 encoded text, also used as product name
                2 => 'product.type', // type of the product, e.g. "default" or "selection"
                3 => 'product.status', // enabled (1) or disabled (0)
              ),
              'text' => array(
                4 => 'text.type', // e.g. "short" for short description
                5 => 'text.content', // UTF-8 encoded text
                6 => 'text.type', // e.g. "long" for long description
                7 => 'text.content', // UTF-8 encoded text
              ),
              'media' => array(
                8 => 'media.url', // relative URL of the product image on the server
              ),
              'price' => array(
                9 => 'price.quantity', // the quantity the price is valid from (for block pricing)
                10 => 'price.value', // price with decimals separated by a dot, no thousand separator
                11 => 'price.taxrate', // tax rate with decimals separated by a dot
              ),
              'property' => array(
                14 => 'product.property.value', //
                15 => 'product.property.type', // color code
                16 => 'product.property.value', //
                17 => 'product.property.type', // sku code
                60 => 'product.property.value', //
                61 => 'product.property.type', // manufacturer color
              ),
              'catalog' => array(
                13 => 'catalog.list.type', // standard
                12 => 'catalog.code', // manufacturer
                18 => 'catalog.list.type', // decade of creation
                19 => 'catalog.code', // 20s
                20 => 'catalog.list.type', //
                21 => 'catalog.code', // 30s
                22 => 'catalog.list.type', //
                23 => 'catalog.code', // 40s
                24 => 'catalog.list.type', //
                25 => 'catalog.code', // 50s
                26 => 'catalog.list.type', //
                27 => 'catalog.code', // 60s
                28 => 'catalog.list.type', //
                29 => 'catalog.code', // 70s
                30 => 'catalog.list.type', //
                31 => 'catalog.code', // 80s
                32 => 'catalog.list.type', //
                33 => 'catalog.code', // 90s
                34 => 'catalog.list.type', //
                35 => 'catalog.code', // 2000s
                36 => 'catalog.list.type', //
                37 => 'catalog.code', // 2010s
                38 => 'catalog.list.type', // color group
                39 => 'catalog.code', // reds just as an example,this might not be red
                40 => 'catalog.list.type', //
                41 => 'catalog.code', //
                42 => 'catalog.list.type',
                43 => 'catalog.code', //
                44 => 'catalog.list.type',
                45 => 'catalog.code', //
                46 => 'catalog.list.type',
                47 => 'catalog.code', //
                48 => 'catalog.list.type',
                49 => 'catalog.code', //
                50 => 'catalog.list.type',
                51 => 'catalog.code', //
                52 => 'catalog.list.type',
                53 => 'catalog.code', //
                54 => 'catalog.list.type',
                55 => 'catalog.code', // product group
              ),

              'stock' => array(
                56 => 'product.stock.stocklevel',
                57 => 'product.stock.warehouse',
                58 => 'product.stock.warehouseid',
                59 => 'product.stock.dateback',
              ),
//              'attribute' => array(
//                43 => 'attribute.type', //
//                44 => 'attribute.code', // blues
//              ),
//              'attribute' => array(
//                45 => 'attribute.type', //
//                46 => 'attribute.code', // greys
//              ),
//              'attribute' => array(
//                47 => 'attribute.type', //
//                48 => 'attribute.code', // whites
//              ),
//              'attribute' => array(
//                49 => 'attribute.type', //
//                50 => 'attribute.code', // browns
//              ),
//              'attribute' => array(
//                51 => 'attribute.type', //
//                52 => 'attribute.code', // whites
//              ),
//              'attribute' => array(
//                53 => 'attribute.type', //
//                54 => 'attribute.code', // blacks
//              ),
//              'product' => array(
//                38 => 'product.code', // e.g. EAN code of another product
//                39 => 'product.list.type', // e.g. "suggestion" for suggested product
//              ),
//              'property' => array(
//                40 => 'product.property.value', // arbitrary value for the corresponding type
//                41 => 'product.property.type', // e.g. "package-weight"
//              ),
//              'catalog' => array(
//                42 => 'catalog.code', // e.g. Unique category code
//                43 => 'catalog.list.type', // e.g. "promotion" for top seller products
//              ),
            )

          )
        )
      )
    )
  ),

  'i18n' => array(),

  'mshop' => array(
    'price' => array(
      'taxflag' => 0
    )
  ),

  'madmin' => array(
    'cache' => array(
      'manager' => array(
        'name' => 'None',
      ),
    ),
  ),

);
Last edited by jossnaz on 28 Aug 2016, 18:02, edited 1 time in total.

jossnaz
Posts: 46
Joined: 22 Jul 2016, 01:19

Re: Tax calculation in the US per state?

Post by jossnaz » 27 Aug 2016, 22:05

look in

ff-laravel/ext/ai-client-html/client/html/templates/common/partials/address-default.php

line:

Code: Select all

if( count( $states ) > 1 )
states is currently

Code: Select all

$states array(1)
→'US' => array(62)
so it fails...

should be >= 1

should i create pull requests for that kind of stuff?

User avatar
aimeos
Administrator
Posts: 7835
Joined: 01 Jan 1970, 00:00

Re: Tax calculation in the US per state?

Post by aimeos » 28 Aug 2016, 00:44

You are right, that's the problem. I've fixed that in the current dev-master branch.
Thanks for reporting!
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply