#StackBounty: #magento2 #setup-di-compile Cannot put magento 2 into production mode due to an error in setup:di:compile:

Bounty: 50

We are trying to put a site into production mode but we get errors during the setup:di:compile step.

Below all the details I think are relevant:

Php 7.0.15

I have cleaned the cache with bin/magento cache:clean right before i executed the command.

When I try to run bin/magento setup:di:compile I get the following output:

Compilation was started.
Application code generator... 3/7 [============>---------------]  42% 55 secs 150.0 MiBPHP Fatal error:  Cannot declare interface MagentoFrameworkDBAdapterAdapterInterface, because the name is already in use in /xxxxx/www/vendor/magento/framework/DB_bu/Adapter/AdapterInterface.php on line 15

Segmentation fault

We need the production mode because we are trying to optimise for better loading times.

Edit:

The error in the error log:

2017-03-23 16:10:54] main.INFO: Add of item with id Magento_Search::report_search_term was pro
cessed [] []
[2017-03-23 16:10:54] main.INFO: Add of item with id FME_Extensions::fmeextensions was processe
d [] []
[2017-03-23 16:10:54] main.INFO: Add of item with id FME_Extensions::productattachments was pro
#5 /data/sites/web/xxxxxxx/www/vendor/magento/framework/View/Page/Config/Renderer.php(35
8): MagentoFrameworkViewAssetMerged->rewind()
#6 /data/sites/web/xxxxxxx/www/vendor/magento/framework/View/Page/Config/Renderer.php(25
1): MagentoFrameworkViewPageConfigRenderer->renderAssetHtml('<script  type="...', Object(M
agentoFrameworkViewAssetMerged))
#7 /data/sites/web/xxxxxxx/www/vendor/magento/framework/View/Page/Config/Renderer.php(22
6): MagentoFrameworkViewPageConfigRenderer->renderAssetGroup(Object(MagentoFrameworkView
AssetPropertyGroup))
#8 /data/sites/web/xxxxxxx/www/vendor/magento/framework/View/Page/Config/Renderer.php(99
): MagentoFrameworkViewPageConfigRenderer->renderAssets(Array)
#9 /data/sites/web/xxxxxxx/www/vendor/magento/framework/View/Result/Page.php(235): Magen
toFrameworkViewPageConfigRenderer->renderHeadContent()
#10 /data/sites/web/xxxxxxx/www/vendor/magento/framework/View/Result/Layout.php(164): Ma
gentoFrameworkViewResultPage->render(Object(MagentoFrameworkAppResponseHttpInterceptor
))
#11 /data/sites/web/xxxxxxx/www/vendor/magento/framework/Interception/Interceptor.php(74
): MagentoFrameworkViewResultLayout->renderResult(Object(MagentoFrameworkAppResponseHtt
pInterceptor))
#12 /data/sites/web/xxxxxxx/www/vendor/magento/framework/Interception/Chain/Chain.php(70
#5 /data/sites/web/xxxxxxx/www/vendor/magento/framework/View/Page/Config/Renderer.php(3
58): MagentoFrameworkViewAssetMerged->rewind()
#6 /data/sites/web/xxxxxxx/www/vendor/magento/framework/View/Page/Config/Renderer.php(2
51): MagentoFrameworkViewPageConfigRenderer->renderAssetHtml('<script  type="...', Object
(MagentoFrameworkViewAssetMerged))
#7 /data/sites/web/xxxxxxx/www/vendor/magento/framework/View/Page/Config/Renderer.php(2
26): MagentoFrameworkViewPageConfigRenderer->renderAssetGroup(Object(MagentoFrameworkVi
ewAssetPropertyGroup))
#8 /data/sites/web/xxxxxxx/www/vendor/magento/framework/View/Page/Config/Renderer.php(9
9): MagentoFrameworkViewPageConfigRenderer->renderAssets(Array)
#9 /data/sites/web/xxxxxxx/www/vendor/magento/framework/View/Result/Page.php(235): Mage
ntoFrameworkViewPageConfigRenderer->renderHeadContent()
#10 /data/sites/web/xxxxxxx/www/vendor/magento/framework/View/Result/Layout.php(164): M
agentoFrameworkViewResultPage->render(Object(MagentoFrameworkAppResponseHttpIntercept
or))
#11 /data/sites/web/xxxxxxx/www/vendor/magento/framework/Interception/Interceptor.php(7
4): MagentoFrameworkViewResultLayout->renderResult(Object(MagentoFrameworkAppResponseH
ttpInterceptor))
#12 /data/sites/web/xxxxxxx/www/vendor/magento/framework/Interception/Chain/Chain.php(7
0): MagentoFrameworkViewResultPageInterceptor->___callParent('renderResult', Array)
#5 /data/sites/web/xxxxxxx/www/vendor/magento/framework/View/Page/Config/Renderer.php(
358): MagentoFrameworkViewAssetMerged->rewind()
#6 /data/sites/web/xxxxxxx/www/vendor/magento/framework/View/Page/Config/Renderer.php(
251): MagentoFrameworkViewPageConfigRenderer->renderAssetHtml('<script  type="...', Obje
ct(MagentoFrameworkViewAssetMerged))
#7 /data/sites/web/xxxxxxx/www/vendor/magento/framework/View/Page/Config/Renderer.php(
226): MagentoFrameworkViewPageConfigRenderer->renderAssetGroup(Object(MagentoFramework
ViewAssetPropertyGroup))
#8 /data/sites/web/xxxxxxx/www/vendor/magento/framework/View/Page/Config/Renderer.php(
99): MagentoFrameworkViewPageConfigRenderer->renderAssets(Array)
#9 /data/sites/web/xxxxxxx/www/vendor/magento/framework/View/Result/Page.php(235): Mag
entoFrameworkViewPageConfigRenderer->renderHeadContent()
#10 /data/sites/web/xxxxxxx/www/vendor/magento/framework/View/Result/Layout.php(164):
MagentoFrameworkViewResultPage->render(Object(MagentoFrameworkAppResponseHttpInterce
ptor))
#11 /data/sites/web/xxxxxxx/www/vendor/magento/framework/Interception/Interceptor.php(
74): MagentoFrameworkViewResultLayout->renderResult(Object(MagentoFrameworkAppResponse
HttpInterceptor))
#12 /data/sites/web/xxxxxxx/www/vendor/magento/framework/Interception/Chain/Chain.php(
70): MagentoFrameworkViewResultPageInterceptor->___callParent('renderResult', Array)
#6 /data/sites/web/xxxxxxx/www/vendor/magento/framework/View/Page/Config/Renderer.php(251
): MagentoFrameworkViewPageConfigRenderer->renderAssetHtml('<script  type="...', Object(Mag
entoFrameworkViewAssetMerged))
#7 /data/sites/web/xxxxxxx/www/vendor/magento/framework/View/Page/Config/Renderer.php(226
): MagentoFrameworkViewPageConfigRenderer->renderAssetGroup(Object(MagentoFrameworkViewA
ssetPropertyGroup))
#8 /data/sites/web/xxxxxxx/www/vendor/magento/framework/View/Page/Config/Renderer.php(99)
: MagentoFrameworkViewPageConfigRenderer->renderAssets(Array)
#9 /data/sites/web/xxxxxxx/www/vendor/magento/framework/View/Result/Page.php(235): Magent
oFrameworkViewPageConfigRenderer->renderHeadContent()
#10 /data/sites/web/xxxxxxx/www/vendor/magento/framework/View/Result/Layout.php(164): Mag
entoFrameworkViewResultPage->render(Object(MagentoFrameworkAppResponseHttpInterceptor))
#11 /data/sites/web/xxxxxxx/www/vendor/magento/framework/Interception/Interceptor.php(74)
: MagentoFrameworkViewResultLayout->renderResult(Object(MagentoFrameworkAppResponseHttp
Interceptor))
#12 /data/sites/web/xxxxxxx/www/vendor/magento/framework/Interception/Chain/Chain.php(70)
: MagentoFrameworkViewResultPageInterceptor->___callParent('renderResult', Array)
#13 /data/sites/web/xxxxxxx/www/vendor/magento/framework/Interception/Chain/Chain.php(63)
: MagentoFrameworkInterceptionChainChain->invokeNext('Magento\Framewo...', 'renderResult',
Object(MagentoFrameworkViewResultPageInterceptor), Array, 'result-varnish-...')
#14 /data/sites/web/xxxxxxx/www/vendor/magento/module-page-cache/Model/Controller/Result/
VarnishPlugin.php(74): MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptio
nChain{closure}(Object(MagentoFrameworkAppResponseHttpInterceptor))
#15 /data/sites/web/xxxxxxx/www/vendor/magento/framework/Interception/Chain/Chain.php(67)
: MagentoPageCacheModelControllerResultVarnishPlugin->aroundRenderResult(Object(MagentoFra
meworkViewResultPageInterceptor), Object(Closure), Object(MagentoFrameworkAppResponseHtt
pInterceptor))
#16 /data/sites/web/xxxxxxx/www/vendor/magento/framework/Interception/Interceptor.php(138
): MagentoFrameworkInterceptionChainChain->invokeNext('Magento\Framewo...', 'renderResult',
 Object(MagentoFrameworkViewResultPageInterceptor), Array, 'result-builtin-...')
#17 /data/sites/web/xxxxxxx/www/vendor/magento/module-page-cache/Model/Controller/Result/
BuiltinPlugin.php(67): MagentoFrameworkViewResultPageInterceptor->MagentoFrameworkInterce
ption{closure}(Object(MagentoFrameworkAppResponseHttpInterceptor))
#18 /data/sites/web/xxxxxxx/www/vendor/magento/framework/Interception/Interceptor.php(142
): MagentoPageCacheModelControllerResultBuiltinPlugin->aroundRenderResult(Object(MagentoFr
ameworkViewResultPageInterceptor), Object(Closure), Object(MagentoFrameworkAppResponseHt
tpInterceptor))
#19 /data/sites/web/xxxxxxx/www/var/generation/Magento/Framework/View/Result/Page/Interce
ptor.php(130): MagentoFrameworkViewResultPageInterceptor->___callPlugins('renderResult', Ar
ray, Array)
#20 /data/sites/web/xxxxxxx/www/vendor/magento/framework/App/Http.php(139): MagentoFrame
workViewResultPageInterceptor->renderResult(Object(MagentoFrameworkAppResponseHttpInter
ceptor))
#21 /data/sites/web/xxxxxxx/www/vendor/magento/framework/App/Bootstrap.php(258): Magento
FrameworkAppHttp->launch()
#22 /data/sites/web/xxxxxxx/www/index.php(39): MagentoFrameworkAppBootstrap->run(Objec
t(MagentoFrameworkAppHttp))
#23 {main} [] []


Get this bounty!!!

#StackBounty: #magento2 #layered-navigation magento 2 Use in Layered Navigation option showing backend

Bounty: 50

I am using Magento ver. 2.1.4 in Backend I add Attribute it not showing in front end

In Backend Use in Layered Navigation option also not showing in backend

enter image description here
enter image description here
enter image description here


Get this bounty!!!

#StackBounty: #magento2 #shipping #ups Magento 2 – Error displaying Shipping Rates with UPS XML configuration

Bounty: 50

I am trying to setup UPS XML method for Shipping Rates, and it seems to work for any address in California. When I try an address outside of California, I do not get any shipping rates back.

enter image description here

So I looked at the Magento debug.log and saw the below response. My assumption is that it is replacing the StateProvinceCode for CA when its sending the request to UPS.

I looked at the following link https://github.com/magento/magento2/issues/6875 thinking the issue could be fixed, but its still ignoring the region in the Shipping Method.

'accessRequest' => '<?xml version="1.0"?>
<AccessRequest xml:lang="en-US">
  <AccessLicenseNumber>XXXXXXXX</AccessLicenseNumber>
  <UserId>****</UserId>
  <Password>****</Password>
</AccessRequest>
',
  'request' => '<?xml version="1.0"?>
<RatingServiceSelectionRequest xml:lang="en-US">
  <Request>
    <TransactionReference>
      <CustomerContext>Rating and Service</CustomerContext>
      <XpciVersion>1.0</XpciVersion>
    </TransactionReference>
    <RequestAction>Rate</RequestAction>
    <RequestOption>Shop</RequestOption>
  </Request>
  <PickupType>
          <Code>03</Code>
          <Description>Customer Counter</Description>
  </PickupType>

  <Shipment>      <Shipper>      <Address>
          <City></City>
          <PostalCode>90034</PostalCode>
          <CountryCode>US</CountryCode>
          <StateProvinceCode>CA</StateProvinceCode>
      </Address>
    </Shipper>
    <ShipTo>
      <Address>
          <PostalCode>28607</PostalCode>
          <CountryCode>US</CountryCode>
          <ResidentialAddress>01</ResidentialAddress>
          <StateProvinceCode>CA</StateProvinceCode><ResidentialAddressIndicator>01</ResidentialAddressIndicator>      </Address>
    </ShipTo>


    <ShipFrom>
      <Address>
          <PostalCode>90034</PostalCode>
          <CountryCode>US</CountryCode>
          <StateProvinceCode>CA</StateProvinceCode>
      </Address>
    </ShipFrom>

    <Package>
      <PackagingType><Code>00</Code></PackagingType>
      <PackageWeight>
         <UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement>
        <Weight>8</Weight>
      </PackageWeight>
    </Package>  </Shipment>
</RatingServiceSelectionRequest>',
  'result' => '<?xml version="1.0"?>
<RatingServiceSelectionResponse><Response><TransactionReference><CustomerContext>Rating and Service</CustomerContext><XpciVersion>1.0</XpciVersion></TransactionReference><ResponseStatusCode>0</ResponseStatusCode><ResponseStatusDescription>Failure</ResponseStatusDescription><Error><ErrorSeverity>Hard</ErrorSeverity><ErrorCode>111285</ErrorCode><ErrorDescription>The postal code 28607 is invalid for CA United States.</ErrorDescription></Error></Response></RatingServiceSelectionResponse>


Get this bounty!!!

#StackBounty: #magento2 #custom #payment-methods #paypal #magento2.1.5 Magento 2: How to Refund, Cancel & Re-Authorize Paypal Order…

Bounty: 50

How to use below function for already Ordered by Paypal

magentovendormagentomodule-paypalModelExpress.php

refund()
void()

First need to load the Order then will get the payment

$orderId = 1;

$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$order = $objectManager->create('MagentoSalesModelOrder')->load($orderId); 
$order->getPayment()

After Refund & Cancel Order from Paypal need to Update Order Status accordingly & Notify Customer.

Re-Authorization: https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/authcapture/ Paypal holds payment for 29 days. How can I extend it?


Get this bounty!!!

#StackBounty: #magento2 #checkout #cart #sales Disable entire cart functionlity & checkout in magento2

Bounty: 50

From admin side i can disable one step checkout,but still users can add products to cart.I want to display only products without checkout.
Is there any extension there?
I mean disable mini cart,add to cart links entire site.

Where can i customize through plugins or observers or rewrite (mostly in single shot) so that it will hide add to cart links everywhere.
By editing list.phtml i can do.but is there any better way?


Get this bounty!!!

#StackBounty: #magento2 #magento-2.1.4 update quote item in magento2

Bounty: 50

I am trying to update quote item in magento2. But every time i am saving the item its creating a new item with the same quote id rather than updating it. Here is my code

    public function __construct(
            MagentoQuoteModelQuoteRepository $quoteRepo
        ){
            $this->_quoteRepo = $quoteRepo;
        }

public function updateItem(){
    $quote = $this->_quoteRepo->get('id here');
    foreach($quote->getAllVisibleItems() as $itemq){
    $itemq->setQty(5);
    $itemq->setPrice(20);
    $itemq->save();
    }
 }

But every time its saving an item.. a new item is getting generated. Dont know why. Also i couldn't find any class which explicitly load qoute item in magento2. Help will be appreciated.

In this question http://magento.stackexchange.com/questions/139298/how-to-save-quote-items-in-magento-2 they are setting the whole product… not trying to update it. When you set a product a new quote item will surely generate. But why its doing the same in case of updation.


Get this bounty!!!

#StackBounty: #magento2 $collection->addAttributeToFilter works if cache disabled, but not if enabled

Bounty: 50

$myattr = $this->catalogSession->getData('myattribute');
if(!empty($myattr)){
    $collection = $this->_catalogLayer->getProductCollection();
    $attribute = $this->eavConfig->getAttribute('catalog_product', 'myattribute');
    $option_id = $attribute->getSource()->getOptionId($myattr);
    $collection->addAttributeToFilter('myattribute',array('finset'=>$option_id));
}

in Block/Category/MyattributeChooser.php in the _prepareLayout function

This works if I have caching disabled OR I select any filter at all. It does not work if caching is enabled but I used my custom chooser and no other filters are displayed.

I need to know how to make it work. This is on a categories page. I could just totally turn off caching for the chooser but that isn’t a very good answer.

I’ve found too that although it works it doesn’t recalculate pagination either. $collection->getSize() results in an Illegal State error and $collection->clear() and $collection->resetData() have no effect on anything whatsoever. $collection->isLoaded() returns NULL.


Get this bounty!!!

#StackBounty: #magento2 #layout #template #related-products Move related products to custom div in custom phtml template

Bounty: 50

I have made a custom phtml template called configurator.phtml on the product view page, like this:

    <referenceContainer name="page.wrapper">
        <block class="MagentoCatalogBlockProductView" name="configurator" template="product/view/configurator/configurator.phtml" before="-">
        </block>
    </referenceContainer>

The template looks like this:

<i class="material-icons close-configurator">close</i> </div>
</div>
</div> </div> </div> </div>

Inside .meal-selector-products I want to display the related products. How can I move the related products to a custom div? I just can’t figure out how to do it…


Get this bounty!!!

#StackBounty: #magento2 #menu Custom drop down menu in responsive navigation

Bounty: 50

We utilized a XML snippet in order to load a specific block into the Topnavi.

Now, when in responsive mode we are having all topmenu items as a normal list in the menu.

Normal:
Normal view
Responsive view:
Responsive view

I do want to have “Sales Partners”, “Electronic Components”, … in a specific Submenu, like I have it for the Menu items:

enter image description here

How can I do this? In my default.xml I have something like this:

<referenceContainer name="header.panel">
      <block class="MagentoCmsBlockBlock" name="top-navigation">
                <arguments>
                    <argument name="block_id" xsi:type="string">top-navigation</argument>
                    <argument name="css_class" xsi:type="string">header links</argument>
                </arguments>
            </block>
        </referenceContainer>

This loads the desired block which is a block due to the translation problems we have for multilingual pages.


Get this bounty!!!

#StackBounty: #magento2 #magento-2.1 Change the checkout form field classes and names

Bounty: 50

I am trying to figure out how to customize the checkout form by changing classes because I want to stylize it with bootstrap instead of the default Magento styles. I don’t see them defined anywhere and with my reading and looking at the Magento developer documentation it looks like they are dynamically generated http://devdocs.magento.com/guides/v2.0/howdoi/checkout/checkout_new_field.html But in that documentation it doesn’t look like there is any way of adding custom classes to the wrapper elements or anything.

This is the default output for the First Name:

</div>

I would prefer to have an output similar to this:

</div>

Notice how there is now a form-group and form-control class added. How does one accomplish this if everything is dynamically generated?


Get this bounty!!!