texts: Magento 2.2.5: Explain about Position in "Catalog_Category_Product"

texts:
I'm looking for an explaination about column "Position" in table "Catalog_Category_Product".
I dont understand what is 0 and 1 in that column, and what does it for?
Thanks for reading. Have a good day :)

EDIT 1:

Maybe i'm not clear enough when asking the question, so...

I'm trying to do "banner_slider" follow the structure of "catalog_category_product"

  C:\xampp\htdocs\magento\vendor\magento\module-catalog\Block\Adminhtml\Category\AssignProducts.php

So in that code, i debug with xdebug phpstorm and realize that position="1" show in "yes", but in the database it have position="0" as well. I dont know what it does .. That's what i'm wondering
Here is what i debug:

public function getProductsJson()
{
    $products = $this->getCategory()->getProductsPosition();
    if (!empty($products)) {
        return $this->jsonEncoder->encode($products);
    }
    return '{}';
}

After running that code, they render throught this in "getProductsJson()" function:

  C:\xampp\htdocs\magento\vendor\magento\module-catalog\view\adminhtml\templates\catalog\category\edit\assign_products.phtml

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

/** @var \Magento\Catalog\Block\Adminhtml\Category\AssignProducts $block */

/** @var \Magento\Catalog\Block\Adminhtml\Category\Tab\Product $blockGrid */
$blockGrid = $block->getBlockGrid();
$gridJsObjectName = $blockGrid->getJsObjectName();
?>
<?= $block->getGridHtml() ?>
<input type="hidden" name="category_products" id="in_category_products" data-form-part="category_form" value="" />
<script type="text/x-magento-init">
    {
        "*": {
            "Magento_Catalog/catalog/category/assign-products": {
                "selectedProducts": <?= /* @escapeNotVerified */ $block->getProductsJson() ?>,
                "gridJsObjectName": <?= /* @escapeNotVerified */ '"' . $gridJsObjectName . '"' ?: '{}' ?>
            }
        }
    }
</script>
<!-- @todo remove when "UI components" will support such initialization -->
<script>
    require('mage/apply/main').apply();
</script>


texts:
I've noticed the following style PHPDoc declarations in Magento core code, and subsequently copied in Magento extensions:

/** @var $varName Mage_Core_Model_Example */

Should it not follow the @var [type] [$optionalName] [Optional comment] concept that PHPDoc uses? Eg:

/** @var Mage_Core_Model_Example $optionalVarNameOrComment Optional comment here */

Or more simply in practice:

/** @var Mage_Core_Model_Example */
$example = Mage::getModel('core/example');

Edit: maybe it's just inconsistency among their development team... I found an example of what I would consider a correct @var block while reviewing the EE 1.14.2 changes:

# app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php - 1531:
/** @var Mage_Sales_Model_Order $oldOrder */


texts: Magento 2: How to add popup on button click in admin?

texts:
Can you explain how to add popup(modal window) on button click in the adminhtml?
I already create some phtml

    <?php foreach ($this->getCollection() as $reminder):
    ?>

Customer name - <?php echo $reminder->getCustomerName()
            ?>(Order ID #<?php echo $reminder->getOrderIncrementId() ?>); Date/Time - <?php echo $reminder->getDatetime()
            ?>; Due Date/Time - <?php echo $reminder->getDuedatetime() ?>; Assigned to User - <?php echo $reminder->getName() ?>;
            Note - <?php echo $reminder->getTitle() ?><button class="action- scalable primary">asd</button>

    <?php endforeach; ?>

And I really need to know how to add modal action to the button.


texts: Magento 2.2.5: Error on cron:run after every production deployment

texts:
Since we upgraded Magento to 2.2.5, after every deployment to production (which includes git pull..., composer update & all other relevant Magento CLI commands for production deployment), our indexers stops to work & when we check the cron by running php bin/magento cron:run we get this error:

  PHP Fatal error:  Uncaught Error: Cannot instantiate interface Magento\Framework\Lock\LockManagerInterface in /.../vendor/magento/framework/ObjectManager/Factory/AbstractFactory

The only way we found that seems to solve this (temporarily) is to clear the composer cache, remove the vendor dir, running composer update again & re-deploying Magento again.
We have to do that every time, after every deployment & it's really annoying.


texts: magento 2 how add new tab to layered navigation?

texts: I need some help. I add new category with layered navigation and I have all product from my base on this page. How we can add new tab to layered navigation with some options like "free products" and "sale". I hope for your help!


texts:
I'm working in windows environment, But I want to access Linux Magento directory(htdocs) as well database(phpmyadmin) which is hosted in RackSpace.

Could you please instruct me the steps to achieve?


texts: How to attach Invoice PDF in invoice email

texts:
I want to attach invoice pdf to the invoice mail, I followed the link and override the email functions.

First Override the app/code/Mage/core/Model/Email/Template/Mailer.php like,

Adding protected $pdftemplate;
Overriding the send() function,

if($this->pdftemplate){
            $pdftemplate = $this->variable;
        }else{
            $pdftemplate = Mage::getModel('core/email_template');
        }
Adding attachment function at the end of the class,

/** Add Attachment**/

public function addAttachment(Zend_Pdf $pdf, $filename){
    $file = $pdf->render();
    $this->pdftemplate = Mage::getModel('core/email_template');
    $attachment = $this->pdftemplate->getMail()->createAttachment($file);
    $attachment->type = 'application/pdf';
    $attachment->filename = $filename;
}

Second I override the app/code/Mage/Sales/Order/Invoice.php, sendEmail() function,

$mailer = Mage::getModel('core/email_template_mailer');
        $pdf = Mage::getModel('sales/order_pdf_invoice')->getPdf(array($this));
        $mailer->addAttachment($pdf,'invoice.pdf');

But the pdf is not attached. I don't know what to do next. I hope someone will point me the issue.

Thanks!..


texts: Unable to access collection from custom model, returns null

texts:
I have been trying to access 2 custom created tables which store additional values for a particular order, I am trying to implement a form that saves these details. I am trying to get the last id of the table and increment it by one.

/app/code/local/MyCompany/LinkCustomTable/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <MyCompany_LinkCustomTable>
            <version>0.1.0</version>
        </MyCompany_LinkCustomTable>
    </modules>
    <global>
        <models>
            <mycompany_linkcustomtable>
                <class>MyCompany_LinkCustomTable_Model</class>
                <resourceModel>linkcustomtable_resource</resourceModel>
            </mycompany_linkcustomtable>

            <linkcustomtable_resource>
                <class>MyCompany_LinkCustomTable_Model_Resource</class>

                <entities>
                    <paxdetails>

mycompany_pax_details

                    </paxdetails>
                    <tripdetails>

mycompany_trip_details

                    </tripdetails>

                </entities>
            </linkcustomtable_resource>
        </models>
        <resources>
            <linkcustomtable_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </linkcustomtable_write>
            <linkcustomtable_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </linkcustomtable_read>
        </resources>
    </global>
</config>

app/code/local/MyCompany/LinkCustomTable/Model/Tripdetails.php
(and app/code/local/MyCompany/LinkCustomTable/Model/Paxdetails.php is similar)

<?php
class MyCompany_LinkCustomTable_Model_Tripdetails extends Mage_Core_Model_Abstract
{

    protected function _construct()
    {
    $this->_init('mycompany_linkcustomtable/tripdetails');
    }
}
?>

app/code/local/MyCompany/LinkCustomTable/Model/Resource/Tripdetails.php
(and app/code/local/MyCompany/LinkCustomTable/Model/Resource/Paxdetails.php is similar)

<?php
class MyCompany_LinkCustomTable_Model_Resource_Tripdetails extends Mage_Core_Model_Resource_Db_Abstract {
    protected function _construct()
    {
    $this->_init('mycompany_linkcustomtable/tripdetails', 'trip_id');
    }
}
?>

app/code/local/MyCompany/LinkCustomTable/Model/Resource/Tripdetails/Collection.php
(and app/code/local/MyCompany/LinkCustomTable/Model/Resource/Paxdetails/Collection.php is similar)

<?php
class MyCompany_LinkCustomTable_Model_Resource_Tripdetails_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract {
    protected function _construct()
    {
        $this->_init('mycompany_linkcustomtable/tripdetails');
    }
}
?>

But when i call the getCollection method on

Mage::getModel('mycompany_linkcustomtable/tripdetails')

ie,

Mage::getModel('mycompany_linkcustomtable/tripdetails')->getCollection();  //->getLastItem()->getData('trip_id');

i get null value, tough there is a row in the mycompany_trip_details table.

I am sure that I am calling the right model because if I specify a different uri for getModel(), I get a error stating called getCollection() on boolean. I am not sure as to why I am unable get the collection from my custom tables. And if i uncomment the last part in the command

ie,

Mage::getModel('mycompany_linkcustomtable/tripdetails')->getCollection()->getLastItem()->getData('trip_id');

I get getLastItem() called on boolean (Mage::getModel('mycompany_linkcustomtable/tripdetails')->getCollection())


texts:
I am trying to add a jquery based module to magento 2 via a module. But I keep getting these errors:

ma5menumin.js:1 Uncaught ReferenceError: $ is not defined
at ma5menumin.js:1

callma5.js:1 Uncaught ReferenceError: define is not defined
at callma5.js:1

I think something is wrong with the requirejs-config file but it's a first timer for me, so i'm not sure what to do.

This is the require-js file:

var config = {
map: {
    '*': {
        "mobilemenu.mobmenu": "Vendor_Module/ma5menumin",
        "mobilemenu.callmenu": "Vendor_Module/callma5"
    }
}
};

I also tried this require-js:

var config = {
paths: {
    "mobilemenu.mobmenu": "Vendor_Module/ma5menumin",
    "mobilemenu.callmenu": "Vendor_Module/callma5"
},
shim: {
    'mobilemenu.mobmenu': {
        'deps': ['jquery']
    },
    'mobilemenu.callmenu': {
        'deps': ['jquery']
    }
}
};

This is my callma5.js script:

define(["jquery"], function($){
    ma5menu({
        position: 'left',
        closeOnBodyClick: true
    });
});

I also tried this callma5.js:

require([
    "jquery"
], function ($) {
    //<![CDATA[
    $(document).ready(function () {
        ma5menu({
            position: 'left',
            closeOnBodyClick: true
        });
    });
    //]]>
});

The ma5menumin file is minified jquery. How can I load these files after jquery is loaded?


texts: How to add new steps or tab to checkout page in Magento2

texts: How to add new tab or step in checkout page of magento2, that i need one more step in checkout page how to do it


texts: Magento 2, How regionUpdater is working?

texts:
I'm trying to figure out how regionUpdater works in Magento 2. Region Updater is when you select a country, Magento reloads the region field depending on which country was selected.

I went to Magento's Checkout module then saw regionUpdater Javascript file in this path:

\vendor\magento\module-checkout\view\frontend\web\js\region-updater.js

I went to my browser and tried to put some breakpoints to it but I cannot see regionUpdater.js is included. I tried many ways to figure out how it is working but cannot understand it.

My purpose is I'm going to implement a **cityUpdater function that help Magento reload the city field based on the region field - the same way as regionUpdater.


texts: How to modify magento admin login feature?

texts:
I have a requirement that , need to change complete design of magento login page and we need to add "captcha" in login form.

What are the modules and templates need to be overridden?


texts: What is the real usage of product attribute: quantity_and_stock_status?

texts:
Magento2 has introduced new product attribute quantity_and_stock_status which hold the value of is_in_stock and qty from $stockItem object.

For those who are curios on the topic - How the quantity_and_stock_status attribute value is populated in product object?

Also, product object has stock-item information as extension_attributes which contain details info on stock/inventory.

Just wondering what was the sole purpose of introducing this new attribute?
For me, it's like overhead. Also seems they want an easy usage somewhere instead of using nested call for extension_attributes.

Please do share if anyone knows something about the real usage of this attribute.


texts: Magento 2: I want to Install another setup of Magento in live site

texts:
I have a Magento store set up already working fine It is using Venus Theme,

Now I wanted to use another theme, When I installed and applied the theme, the Homepage is not working properly, UI is broken, nothing shows on Homepage etc.

I was not able to set the Site right after changing the theme.

Now I wanted to install another setup of Magento in my Cpanel with the sample data to show my management and eventuallycustomize the site and move it to live.

for example: www.example.com/test here I want to install a new version of Magento,

Please help me if this possible or guide the ideal way of doing this. much appreciated your response.


texts: Override Minicart to show in modal Magento v2.3.3

texts:
When i click on the 'action showcart' of the minicart it is displayed in a 'dropdownDialog' just above. This is normal operation

Now I want to display the whole minicart in a modal which is displayed from the right like here ( this is the demo of quick cart of mageplaza)

Should I create a module that overloads the template of the minicart and change the call to it? how can i do that?

    <?= /* @escapeNotVerified */ __('My Cart') ?>

<?php if ($block->getIsNeedToDisplaySideBar()): ?>
    <div class="block block-minicart"
                data-bind="mageInit: {
                'Magento_Ui/js/modal/modal':{
                'type': 'custom',
                'modalClass': 'quickcart-dropdown',
                'trigger': '[data-trigger=quickcart]',
                'wrapperClass': 'quickcart-wrapper',
                'parentModalClass': 'minicart',
                'responsive': true,
                'responsiveClass': 'custom-slide',
                'overlayClass': 'dropdown-overlay modal-custom-overlay',
                'buttons': []
                }}">

        <?= $block->getChildHtml('minicart.addons') ?>

<?php else: ?>

I don't know how to do this, can you help me in the process

Thx


texts: Create in the admin a form with a drop-down list

texts:
I want to create in the admin a form with a drop-down list:
    <?php $url = $this->urlBuilder->getUrl('listtypesnewsletters/index/index'); ?>

    <form action="<?= $url ?>" method="post">
        Select a list:
        <select name="pets" id="pet-select" class="admin__control-select">
            <option value="">--Please choose an option--</option>
            <?php
            foreach($block->getListNewslettersCollection() as $list)
            {
                ?>
                <option value="<?= $list->getNameList() ?>"><?= $list->getNameList() ?></option>
            <?php
            }
            ?>
        </select>
        <input type="submit" class="action-default" value="Select">
        </form>

But when I click on the submit button I am redirected to the admin home.
If I test my link out of the form I am redirected to the correct page.
Anyone have an idea?
Thank you in advance for your help,


texts: How can I tell if a corrupt image file is being used for credit card skimming?

texts:
I'm working with a site that I believe has been hacked to collect customer credit card data, but I can't be certain.

I did not find any suspicious code in the common places I've seen suggested in several articles.

I did find a suspicious "broken" image file in:

/skin/adminhtml/default/default/images/db-tab-bottom-right-bg_bg.gif

I changed the file extension and opened her up, but it's just a wall of encrypted text with JPEG-1.1 scattered about.

How can I tell if the site is compromised?

I have confirmed the patch has been applied, but the hack could have occurred prior to the patch.

EDIT: Affected version is 1.7.0.2


texts: Is it possible to combine 2 different configurable products for color swatch

texts:
I have two configurable products (with sizes) and different colors. Can I combine them in a color swatch, so it switch to the other color?
Or is the best way to make one configurable product with different colors in it?
I can’t find a good (the best) solution for it.
Thanks


texts:
I've got plenty of CMS pages to add. Each of them should use '2 colums with right column' layout. The default is '1 column'.

How can I change the default setting?

Tried this in local.xml:

<cms_page>
    <label>CMS Pages (All)</label>
    <reference name="root">
        <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
        <!-- Mark root page block that template is applied -->
        <action method="setIsHandle"><applied>1</applied></action>
    </reference>
</cms_page>

but it didn't work.

I know I can do this individually for every page, but I want to set the default setting. So I don't have to set it 100 times for every single page.


texts: Magento1.9 : How to implement pwa manifest and serviceworker in theme head.pttml

texts:
I have created a custom magento theme, not integrated any magento function yet, only created phtml files with static data now.

I'm thinking to create PWA for this to get data via API/ajax (when network available) and from cache (offline mode).

But I'm trying to add manifest.json in head.phtml file, but it is showing 404 not found error, while it is exist in same folder. like :

<link rel="manifest" href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN); ?>frontend/default/custom_theme/manifest.json">

Am I going to right way or not?, How should I add manifest.json in head.phtml file?


texts: After install B2B extension storefront not working properly - Magento 2.2.2 EE

texts:
I followed the below steps to install B2B extension in Magento 2.2.2 EE by referring to this link

Install Magento 2.2.2EE with sample data
Run the below commands

composer require magento/extension-b2b
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy
bin/magento queue:consumers:start sharedCatalogUpdatePrice &
bin/magento queue:consumers:start sharedCatalogUpdateCategoryPermissions &
bin/magento queue:consumers:start quoteItemCleaner &
bin/magento queue:consumers:start inventoryQtyCounter &

Enable B2B features in admin http://nimb.ws/s0khR2
Run the reindex command bin/magento indexer:reindex
After that Storefront display no products http://nimb.ws/3W8xKY, all the product/category url goes to no-route page (http://192.168.14.58/2.2.2/no-route)

Please advice me to fix this issue. Thanks.


texts: 1.9.0.1 how to solve The password cannot be empty.problem?

texts: I continue to search for the solution of this problem in magento 1.9.0.1 nothing have worked for me,.please help


texts: How to override/extend base layout file via Module in magento2?

texts:
How can we override/ extend a base layout file via Module in Magento2? For example, I need to override the "catalog_product_prices.xml" from

module-catalog/view/base/layout/catalog_product_prices.xml

to my module say "Mynamespace_Mymodule"?

The content of xml file is

<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
<block class="Magento\Framework\Pricing\Render\RendererPool" name="render.product.prices">
    <arguments>
        <argument name="default" xsi:type="array">
            <item name="default_render_class" xsi:type="string">Magento\Catalog\Pricing\Render\PriceBox</item>
            <item name="default_render_template" xsi:type="string">Magento_Catalog::product/price/default.phtml</item>
            <item name="default_amount_render_class" xsi:type="string">Magento\Framework\Pricing\Render\Amount</item>
            <item name="default_amount_render_template" xsi:type="string">Mymodule_CustomPrice::product/price/amount/default.phtml</item>
            <item name="prices" xsi:type="array">
                <item name="special_price" xsi:type="array">
                    <item name="render_template" xsi:type="string">Magento_Catalog::product/price/special_price.phtml</item>
                </item>
                <item name="tier_price" xsi:type="array">
                    <item name="render_template" xsi:type="string">Magento_Catalog::product/price/tier_prices.phtml</item>
                </item>
                <item name="final_price" xsi:type="array">
                    <item name="render_class" xsi:type="string">Magento\Catalog\Pricing\Render\FinalPriceBox</item>
                    <item name="render_template" xsi:type="string">Magento_Catalog::product/price/final_price.phtml</item>
                </item>
                <item name="custom_option_price" xsi:type="array">
                    <item name="amount_render_template" xsi:type="string">Magento_Catalog::product/price/amount/default.phtml</item>
                </item>
                <item name="configured_price" xsi:type="array">
                    <item name="render_class" xsi:type="string">Magento\Catalog\Pricing\Render\ConfiguredPriceBox</item>
                    <item name="render_template" xsi:type="string">Magento_Catalog::product/price/configured_price.phtml</item>
                </item>
            </item>
            <!--<item name="adjustments" xsi:type="array"></item>-->
        </argument>
    </arguments>
</block>

And here is the image of my folder structure


texts: Magento 1.9.3.7 / SUPEE-10415: PHP "Cannot redefine" and "Cannot redeclare" errors after merge

texts:
If you have Magento 1.9.2.4 (this may apply to other versions too), apply the SUPEE-10415 security patch, and then use Git to merge the result into a branch with Magento 1.9.3.7 in it, then your site will break if you use Git's default settings.

This is because the security patch and Magento 1.9.3.7 declare

Mage_Core_Helper_String::unserialize() and   Mage_Customer_Model_Customer::MAXIMUM_PASSWORD_LENGTH

in different places in the same file, and when you merge with Git's default behavior, it keeps both declarations, which in principle is how you want it to behave - after all, git can't be expected to know very much about PHP syntax, and for all Git cares it's just two code hunks that got added to the same file.

I would add an answer to Security Patch SUPEE-10415 - Possible Issues? but I don't have enough reputation to do so. So I'm choosing to add a question and link to the original instead. I'll also add an answer on how best to fix the problem for those of us who find out about this issue the hard way.


texts: Magento 2: How to add product QTY in layered navigation filter?

texts:
I need to add qty filter in Layered Navigation so Customer can filter products using qty.

I have implemented using product stock status but due to backorders. I need to display products based on actual QTY.

I have tried with using "Magento\Catalog\Model\Layer" Plugin but It's not work for product qty.

Help will be appreciated.

Thank you in Advanced


texts: Onepage checkout processed without payment gateway

texts:
One step checkout is processing order success without payment. I have to manually click on payment gateway radio button then click on proceed It's returning me error from payment extension utility.php order_id or subscription_id must be present.
Checkout.phtml

function onPaymentChange(refresh){
        require(['jquery'], function($){
            window.place_order_click = true;
            $.ajax({
                url:"<?php echo $this->getSavePaymentAddressUrl(); ?>",
                data:$("[name^=billing]"),
                method:"POST",
                dataType:"json",
                success: function(json){
                    if(refresh.length > 0){
                        if(json["success"]){
                            notificationSC('success',json["success"]);
                        }else if(json["error"]){
                            notificationSC('danger',json["error"]);
                        }
                        refreshBlock(refresh,true);
                    }
                    window.place_order_click = false;
                },
                error:function(){
                    window.place_order_click = false;
                }
            });
        });
    }


texts: Adding custom test fields to magento packslip

texts:
i want to add custom field to packslip infact want new format for it as below:

Customer Shipping Add

Admin Address or store address

some other detail

i found page "app/code/core/Mage/Sales/Model/Order/Pdf/shipment.php"

public function getPdf($shipments = array())

how to add this to my pdf


texts:
can you change subnavigation subcategory urls to SEO friendly?  if so how?

ie:

existing = store.com/apparel.html?cat=4

desired = store.com/apparel/shirts.html
or anything close to that.


texts:
after upgrade from 2.3.5 p1 to 2.3.6, when i run setup:upgrade, i am getting this error:
Module 'Magento_Amqp': Error while checking if topic is synchronous
can someone help on it?
thanks in advance


texts: Split Shipment at the time of shipment creation based on the product attribute in magento 1

texts:
I am using magento 1. I want to split the shipment based on the product attribute.

i have followed the link : https://magento.stackexchange.com/questions/12741/auto-split-magento-shipments-based-on-maximum-weight

  This is working fine when i create the shipment manually from admin.
      But its not working when shipment is created via any third party module. Because when shipment create programmatically, it wont invokes the controller.

  So i have also tried with shipment create before event "sales_order_shipment_save_before", but that event also wont work as it falls under infinite loop because whenever i write the code to create the shipment it again calls the shipment create before event.

Any suggestion for this ?


texts: Round Special Price displayed in Catalogue pages (Product Listing Pages) - Magento 2.3.2

texts:
Magento 2.3.2 - I have set discount through Catalog Price Rule. And so in Catalog pages (Product Listing Pages)

there are two Prices displayed

  1) Regular Price
  2) Special Price (discounted Price).

My Problem is - Special Price is appearing in digit. i.e. Regular Price is 355.00 while Special Price is 312.40
I want to Round this Special Price as 312.00.
How to achieve this.

Thanks


texts: How to reset customer store credit in Magento2

texts:
I added a store credit for a customer by mistake, how to revert the operation and reset customer store credit to 0.

Thank you.


texts: Magento 1.9 : Some of Backend Accounts Can Not Login to Admin

texts:
**Some of backend accounts cannot login to admin dashboard** but some accounts can do, I checked users accesses level but I do not know what is problem?

After enter username and password on admin login form, I redirect to frontend dashboard.


texts:
I followed this tutorial to add some new shipping methods to my website

http://www.smashingmagazine.com/2014/01/15/create-custom-shipping-methods-magento/#more-130404

However i now need to disable these methods if an If statement is true. I already have the if statement which unsets the free shipping so i know that works. however i do seem to be able to unset the custom shipping methods. I know it is a long shot but does anyone know how i would go about this??

This is the IF statement i am using to unset free shipping if that helps

<?php if (($_shippingRateGroups = $this->getEstimateRates())): ?>
<form id="co-shipping-method-form" action="<?php echo $this->getUrl('checkout/cart/estimateUpdatePost') ?>">
                               <?php $quote = Mage::getSingleton('checkout/session')->getQuote();
                        $cartItems = $quote->getAllVisibleItems();
                        foreach ($cartItems as $item)
                    {
                        $productId = $item->getProductId();
                        $product = Mage::getModel('catalog/product')->load($productId);
                               if($product->getData('direct_delivery_product')==1){?>

                         <?php echo 'You have direct delivery products in your shopping cart. This means it may take longer than the standard 2-5 working days to deliver.';?>

                            <?php unset($_shippingRateGroups["freeshipping"]);
                             break;
                         }

                    }

                ?>

New collectRate method

public function collectRates(Mage_Shipping_Model_Rate_Request $request)
{
    //return nothing if the shipping method is disabled from config
    if (!$this->getConfigFlag('active')) {
        return false;
    }

    $productId = $item->getProductId();
                        $product = Mage::getModel('catalog/product')->load($productId);
                               if($product->getData('direct_delivery_product')==0){

         return false;
    }

    $result = Mage::getModel('shipping/rate_result');
        /* @var $result Mage_Shipping_Model_Rate_Result */

        $result->append($this->_getStandardShippingRate());
        $result->append($this->_getExpressShippingRate());

        return $result;
}

Thank you if you can help.


texts: Magento2 : mini cart like delete conformation popup

texts:
How to add the popup(when you click on delete item) to a custom button, Screenshot Below

    <?php
$orderStatus = $_order->getStatusLabel();

if ($orderStatus == 'Pending' || $orderStatus == 'Processing')
    {
?>
   <a href="<?php /* @escapeNotVerified */
    echo $block->getBaseUrl() . 'ordercancel/index/ordercancel?orderId=' .       $_order->getId(); ?>" class="action view">
    <?php /* @escapeNotVerified */
    echo __('Cancel Order') ?>

                            <?php
    } ?>

Want to add this popup when customer click order cancel


texts: Changing the frontend URL of an extension

texts:
I have downloaded an extension and by default the frontend URL is /faq

A snippet of the config XML looks like

http://pastebin.com/XPjQfbZr

What do I need to do to make the extension work with the frontend URL of /foo/bar/test/faq?


texts: Magento 2.4.2 Contact Us Page gives 502 Error

texts:
I am using Claue theme magento 2.4.2 with custom page (default) provided by claue theme. Code i was using is given below:
{{block class="Magento\Contact\Block\ContactForm" name="contactForm" template="Magento_Contact::form.phtml"}}

But whenever I open the page in browser I get 502 error and php-fpm user for magento exits. If i remove the template from the above code, then it works fine without any error. I am not sure what's causing the error.
But yes, before this error, what I did was installed module https://github.com/Mestrona/Mestrona_CategoryRedirect, but even though I have now removed it. I am still getting the error. I then deleted the directory root and restored the directory from previous backup, but its still the same.
I am not sure if some data was changed in the database. Any help?
EDIT:
I also removed the redis cache but its still the same.


texts: Magento2 mobile product deatil page how to slide the page while holding down the product image

texts:
I mean:
When I browse the product on the phone side
Fingers slide to the product gallery, only left and right slide to switch pictures, can not slide up and down to switch the page location.
with magento 2.1.x


texts: Database - Our system detected a lock condition in your database

texts:
We are getting an issue with the database.

Below is the message we are getting from the server.

  Our system detected a lock condition in your database. Multiple
  queries were running too long.

The queries were killed to maintain your site's availability. Below is a process list of running queries for your analysis.


texts: Is uniting different variations of a same product under a single configurable product a good idea?

texts:
Maybe this isn't fully related to Magento, but I don't know where else to ask.
I work for an hardware store and we are showing more and more products on our online catalog.
It is obvious that catalog pages will become overcrowded with different variations of the same product, especially since we specialize in screws, nuts and bolts. Already, this can be seen with sockets, or screwdrivers, of different sizes.
The storefront has multiple filters to help the customers find what they need, but at the same time I wonder if filters are either not enough, or if they are going to scare away lazy customers who don't want to click around too much.
So, I wish to unite those kind of items under configurable products, but will it have any impact on search engine results in the long run?
Thanks,


texts: Inline Edit is not working on admin grid

texts:
I need some columns of my grid to be clickable and editable, I'm doing what magento tutorials say but its not working.

I've tried almost everything, and rows are not clickable and the editor does not appear. I think that the inlineEdit isnt even activated on my magento or something like that since i have tried all.

Thanks for the help.

Here is my code for columns part in listing.xml

 <columns name="spinner_columns">
        <settings>
            <editorConfig>
                <param name="clientConfig" xsi:type="array">
                    <item name="saveUrl" xsi:type="url" path="sellermania/market/inlineEdit"/>
                    <item name="validateBeforeSave" xsi:type="boolean">false</item>
                </param>
                <param name="indexField" xsi:type="string">entity_id</param>
                <param name="enabled" xsi:type="boolean">true</param>
                <param name="selectProvider" xsi:type="string">sellermania_market_listing.sellermania_market_listing.sellermania_market_listing.spinner_columns.ids</param>
            </editorConfig>
            <childDefaults>
                <param name="fieldAction" xsi:type="array">
                    <item name="provider" xsi:type="string">sellermania_market_listing.sellermania_market_listing.sellermania_market_listing_columns_editor</item>
                    <item name="target" xsi:type="string">startEdit</item>
                    <item name="params" xsi:type="array">
                        <item name="0" xsi:type="string">${ $.$data.rowIndex }</item>
                        <item name="1" xsi:type="boolean">true</item>
                    </item>
                </param>
            </childDefaults>
        </settings>
        <selectionsColumn name="ids">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="resizeEnabled" xsi:type="boolean">false</item>
                    <item name="resizeDefaultWidth" xsi:type="string">55</item>
                    <item name="indexField" xsi:type="string">entity_id</item>
                </item>
            </argument>
        </selectionsColumn>
        <column name="entity_id">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">textRange</item>
                    <item name="sorting" xsi:type="string">asc</item>
                    <item name="label" xsi:type="string" translate="true">ID</item>
                    <item name="editor" xsi:type="array">
                        <item name="editorType" xsi:type="string">text</item>
                        <item name="validation" xsi:type="array">
                            <item name="required-entry" xsi:type="boolean">true</item>
                        </item>
                    </item>
                </item>
            </argument>
        </column>
    </columns>

</listing>


texts: Wrong Date Getting Saved For An Attribute

texts: I have created an attribute release_date with Date as the input type.When the date is selected as "29-04-2013", it gets saved as "29-04-0013".What could be the problem?


texts: After placing an order the Customer's Account shows "You have placed no orders."

texts:
We are running Magento 1.9.3.3 on Linux CENTOS 6.8 x86_64 standard – host  cPanel & WHM 64.0 (build 29);

A customer placed an order on June 28, 2017 at 10:16:15 AM;

He received the confirmation E-mail and I see the order in the Admin Panel under Orders.  All of the detail appears to be there.  The order is being processed normally in our system. From our standpoint we see no problem.

I can find no errors in the logs at the time of the order. The customer complained that when he logs into his account and views My Orders, he sees the message "You have placed no orders". He did not make the purchase as a guest, I see his name and E-mail associated with the order.

How can I create the records or pointers to make his account display the order?


texts: How to fix this “Running schema recurring.Unique constraint violation found”

texts:
How to fix this error

  "Running schema recurring.Unique constraint violation found".

This statement occurs when I used upgrade command of Magento 2 model upgradation.


texts: 2.4.1 Elasticsearch configuration shows no product pages

texts:
Using Magento 2.4.1.  Elasticsearch successfully installed and configured but product pages shows errors
Error: Call to a member function isAvailableForCompare() on null in /home/happysite/public_html/vendor/magento/module-catalog/view/frontend/templates/product/view/addto/compare.phtml:11 Stack trace: #0
/home/happysite/public_html/vendor/magento/framework/View/TemplateEngine/Php.php(71): include() #1
/home/happysite/public_html/vendor/magento/framework/View/Element/Template.php(273):
Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Catalog\Block\Product\View\AddTo\Compare\Interceptor), '/home/happysite...', Array) #2
/home/happysite/public_html/generated/code/Magento/Catalog/Block/Product/View/AddTo/Compare/Interceptor.php(392): Magento\Framework\View\Element\Template->fetchView('/home/happysite...') #3
/home/happysite/public_html/vendor/magento/framework/View/Element/Template.php(303): Magento\Catalog\Block\Product\View\AddTo\Compare\Interceptor->fetchView('/home/happysite...') #4
/home/happysite/public_html/vendor/magento/framework/View/Element/AbstractBlock.php(1111): Magento\Framework\View\Element\Template->_toHtml() #5
/home/happysite/public_html/vendor/magento/framework/View/Element/AbstractBlock.php(1115): Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element{closure}() #6
curl -XGET 'http://localhost:9200'
{
"name" : "node-1",
"cluster_name" : "my-application",
"cluster_uuid" : "i removed info",
"version" : {
"number" : "7.10.1",
"build_flavor" : "default",
"build_type" : "rpm",
"build_hash" : "i remove info",
"build_date" : "2020-12-05T01:00:33.671820Z",
"build_snapshot" : false,
"lucene_version" : "8.7.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}


texts: PHP Fatal error: main(): Failed opening required 'app/Mage.php' Magento 2

texts:
I'm trying to add a thumbnail image to the view order page in the account section with the following code but it doesn't do anything:

    <?php $_product = Mage::getModel('catalog/product')->load($_item->getId()); ?>
    <img src="<?php echo Mage::helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="" />

I get the following error:
PHP Fatal error:  main(): Failed opening required 'app/Mage.php'

require(__DIR__ . '/app/Mage.php');

Any ideas why this is not working?


texts: How to process payments made by Saved cc

texts:
By mistake I haven't disabled Save cc as a payment method. Someone made a purchase using that method.

How do I process that order?

What do I need to receive that money because there is no place to enter my bank account.

Should I use credit card info and process that payment manually?

Is money withdrawn from the clients cc and if yes -

Where did it went?

Can I cancel that transaction safely so my client is not charged and that money gone who knows where?

Thanks.


texts: How to resolve Magento_Db_Adapter_Pdo_Mysql error in magento

texts:
I got Magento_Db_Adapter_Pdo_Mysql error in my site. I don't know why this happened.

I already did uncomment this section in /includes/config.php

#define('COMPILER_INCLUDE_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'src');
#define('COMPILER_COLLECT_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'stat');

Error

  Warning:
  include_once(/home/xxxx/public_html/xx/xx/includes/src/Varien_Autoload.php):
  failed to open stream: No such file or directory in
  /home/xxxx/public_html/xx/xx/app/Mage.php on line 37 Warning:
  include_once(): Failed opening
  '/home/xxx/public_html/xxx/xx/includes/src/Varien_Autoload.php' for
  inclusion
  (include_path='/home/xxxx/public_html/xx/xx/includes/src:.:/usr/local/lib/php')
  in /home/xxxx/public_html/xx/xx/app/Mage.php on line 37 Fatal error:
  Class 'Varien_Autoload' not found in
  /home/xxxx/public_html/xx/xx/app/Mage.php on line 54


texts:
I want to edit .csv file in module-wishlist to my custom theme.

I have copied the the file from module-wishlist and copied to

  app/design/frontend/vendor/theme/Magento_Wishlist/i18n/en_US.csv.

But not working. Please help.


texts: How to reorder "My Returns" left navigation link in My Account page in frontend (magento2.3(EE))

texts:
How to reorder "My Returns" link in left navigation section in My Account page in magento 2
I have tried like below

I have override the Magento_Rma/layout/customer_account.xml in my theme, and added sort order to that link, nothing works.

2.I have added before="-" nothing works.
3 Tried to move block by using below code

nothing works
Please guide me to sort out this


texts: Is it possible to call phtml of backend in frontend?

texts:
I want to call two phtml in frondend which is admin side phtml

is it possible to call phtml of backend in customer account?

if yes than i want to call this two phtml:

adminhtml\default\default\template\downloadable/product/edit/downloadable/samples.phtml

adminhtml\default\default\template\downloadable/product/edit/downloadable/links.phtml

how to call this phtml?


texts:
I am getting this error on all my product pages. I have not sure what is going on as it was fine the other day. The only thing I have add was magmi for product updates. removed this and I still get the below error

  Fatal error: Call to a member function getHardDrive() on null in
  /volume1/web/magento/app/design/frontend/athlete/default/template/catalog/product/list.phtml
  on line 52

<?php echo $_item->getHardDrive(); ?>

Any help would be great

Thanks


texts: Magento 1.9 database import error in PhpMyadmin

texts:
When I am trying to import SQL file to  database in to PhpMyAdmin I am receiving below error message.

MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '<!DOCTYPE HTML><html lang='en' dir='ltr' class='chrome chrome48'><head><meta cha' at line 1

SQL query:
<!DOCTYPE HTML><html lang='en' dir='ltr' class='chrome chrome48'><head><meta charset="utf-8" /><meta name="robots" content="noindex,nofollow" /><meta http-equiv="X-UA-Compatible" content="IE=Edge"><style id="cfs-style">html{display: none

Error
Static analysis:
14 errors were found during analysis.

Unexpected character. (near "{" at position 223)
Unexpected character. (near ":" at position 231)
Unexpected beginning of statement. (near "DOCTYPE" at position 2)
Unexpected beginning of statement. (near "HTML" at position 10)
Unexpected beginning of statement. (near "html" at position 16)
Unexpected beginning of statement. (near "lang" at position 21)
Unexpected beginning of statement. (near "'en'" at position 26)
Unexpected beginning of statement. (near "dir" at position 31)
Unexpected beginning of statement. (near "'ltr'" at position 35)
Unexpected beginning of statement. (near "class" at position 41)
Unexpected beginning of statement. (near "'chrome chrome48'" at position 47)
Unexpected beginning of statement. (near "head" at position 66)
Unexpected beginning of statement. (near "meta" at position 72)
Unrecognized statement type. (near "charset" at position 77)


texts: Magento 2 | Add submenu to System->Configuration

texts:
I want to add a new submenu to this.
How can I do that and add more submenus to the new submenu?


texts: How to add product images to packing list?

texts:
I currently use the packing list from Magento but I have trouble with not having the product pictures and/or SKU on it.
Can somebody tell me how and/or which code I would need to use to add those to my packing list?
THANKS IN ADVANCE!


texts:
i am working on website where i import products with images from front side.Its works fine.Now i am trying to use same code on admin side but getting error on error.Like on first attempt i got 302 error so i append ?isAjax=true to my url.Now i got another error of {"error":true,"message":"Invalid Form Key. Please refresh the page."}. Why the code differ for admin and front side.How to resolve the invalid form key ? .Thanks in advance

http://example.com/index.php/pmembers/adminhtml_import/importimages/key/1b15e0d33e0bd77554ff51ca3dfa8d5f/?isAjax=true&

My Form is like this

<form id="upload" method="post" action="<?php echo Mage::helper("adminhtml")->getUrl("pmembers/adminhtml_import/importimages")?>?isAjax=true"
enctype="multipart/form-data">


texts:
I want to (Magento ver. 1.9.2.3) default menu in my other phtml file. how to call it?
 I want to display menu onclick


texts: How can I add weight on an order confirmation?

texts:
I would like to add the total cart weight onto the order confirmation. On Magento 1 this code was added-

            <?php echo $this->__('Total UPS Weight:'); ?><?php echo " " . $_order->getWeight(); ?>

So it looked like-

 <?php $i=0; foreach ($_order->getAllItems() as $_item): ?>
<?php if($_item->getParentItem()) continue; else $i++; ?>
<tbody<?php echo $i%2 ? ' bgcolor="#F6F6F6"' : '' ?>>
    <?php echo $this->getItemHtml($_item) ?>

<?php endforeach; ?>

            <?php echo $this->__('Total UPS Weight:'); ?><?php echo " " . $_order->getWeight(); ?>

    <?php echo $this->getChildHtml('order_totals') ?>

On the email/items.phtml file and it worked great. The same code in Magento 2 does not work. I added the code to current Magento 2 code so it looks like-

<?php foreach ($_items as $_item): ?>
        <?php if (!$_item->getParentItem()) : ?>

                <?= $block->getItemHtml($_item) ?>

            <?php echo $this->__('Total UPS Weight:'); ?><?php echo " " . $_order->getWeight(); ?>

        <?php endif; ?>
    <?php endforeach; ?>

When I get the order confirmation it just says-

Error filtering template: Invalid method Magento\Sales\Block\Order\Email\Items::__


texts: How to change Text of qty TO quantity in minicart

texts:
Hello I want to override magento 2 Mini cart  UIComponent's Text from qty to Quantity  please tell How to do so
Thanks,


texts: Getting all products of orders of last 24 hours in magento 1 in a large database

texts:
I have a third party module in my magento 1 which is fetching products like this:
$products = Mage::getModel('catalog/product')->getCollection();
So I want to replace it with selective products which are ordered in last 24 hrs. but the issue is I know how to fetch last 24 hrs orders but they are not returning items(products) ID or SKU. PLease let me know how to get products of last 24 hrs orders.

Here is my query of getting the orders:

$products = Mage::getResourceModel('sales/order_item_collection')
    ->addAttributeToSelect('*')
    ->addFieldToFilter('created_at', array(
    'from'     => strtotime('-1 day', time()),
    'to'       => time(),
    'datetime' => true
))
    ->load();

So how can I edit this to fetch product items instead of order items?

Thank you


texts: Display Product image issue in order email magento2

texts:
I am trying to show product image in order emails.

for that i overrided below file to my custom theme to implement it.

Magento_Sales/templates/email/items/order/default.phtml

$_order = $_item->getOrder();
$_store = $_order->getStore();
$_imageHelper = \Magento\Framework\App\ObjectManager::getInstance()- >get('Magento\Catalog\Helper\Image');
$_baseImageUrl = $_store->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA).'catalog/product';

$productRepository = \Magento\Framework\App\ObjectManager::getInstance()->get('Magento\Catalog\Api\ProductRepositoryInterface');
$productSku = $block->getSku($_item);
$productObj = $productRepository->get($productSku);
$imageUrl = $_imageHelper->init($productObj, 'small_image', ['type'=>'small_image'])->keepAspectRatio(true)->resize('65','65')->getUrl();

Then after the line

<?= $block->escapeHtml($_item->getName()) ?>

I added my code like below.

<img src="<?php echo $imageUrl; ?>" alt="Product Image">

This is showing always src as unknown.

But the image is there.


texts: Change currency according to customer group

texts:
My base currency is USD. I want to change according to customer-group i.e. If customer group "Retailer" the currency =EUR.

So far I managed to get customer's group code:

$groupId = Mage::getSingleton('customer/session')->getCustomerGroupId();
$customer = Mage::getModel('customer/group')->load($groupId)->getCustomerGroupCode();

if($customer == 'Retailer') { /* Change currency to EUR */ }

Any help would be appreciated!


texts:
I am using Magneto2.3.1 I need to When customers want to return a product, they have to fill in a return form. The customer must fill in this form directly online. After finishing it he should be able to confirm it, by klicking on a button «ok». This generates an email which is sent to: info@xxx.ch. After that, the customer has to be able to print this form (generated pdf) The form should look something like the enclosed file «Retourenformular»

If any one idea how to do this and if any suggested plugin reply me


texts: Magento CE 2.3.5-p1 Admin error when editing product - Session ID is not used as URL parameter anymore

texts:
Having recently upgraded to community edition ver. 2.3.5-p1, and I've run into an error when editing a product in the admin.

While logged in, if I goto a product page to edit, e.g.

hostname/admin/catalog/product/edit/id/1/key/0f76b993ab32a0a1700d6f5c1e0ecbe55ac5d88004e0971e2ac4f26cc0e837e5/

I see the product name, then an error and nothing else as shown in the photo.

The error text is:
User Deprecated Functionality: Session ID is not used as URL parameter anymore. in /domains/hostname/http/vendor/magento/framework/Url.php on line 763

The only error I've been able to find in the logs is the same.

[2020-05-20 22:40:06] main.CRITICAL: User Deprecated Functionality: Session ID is not used as URL parameter anymore. in /domains/hostname/http/vendor/magento/framework/Url.php on line 763 [] []

I hope somebody can offer a suggestion?  Note that Session IDs are not visible in the URLs on the consumer frontend. However I do have the site open in the same browser as the admin.

Thanks

Don


texts:
Does Magento 2 allow JavaScript session storage?
Description:  Actually, I want to store data inside the session of JS and utilize it in other phtml files which are actually replacing the previous one.
For example, I have phtml1 and phtml2, I am replacing phtml1 by phtml2 but I want to use some value from phtml1 in phtml2 for which I am using JAVASCRIPT session.


texts: No theme and wrong redirection after moving live site to local server - Magento 1.7

texts:
I've taken over responsibility of a Magento installation.
Since the installation requires updates and further progress I've decided to move a copy of the live shop to a local web server for testing puroses.

I've setup a Centos 7 server with php56, mariadb an further more to meet the requirements.
Moved the files from live server to local server - set directory permission to 0777
cleared /tmp , /var/session and /var/cache folders
Made database backup - imported database to local mariadb
changed web/unsecure/base_url and web/secure/base_url entry from www.mysite.com to local-server-ip/magento-folder
Edited app/etc/local.xml

When I open the site (local-server-ip/magento/index.php) in browser the side loads but not the theme.
And when I click on any link it redirects me to local-server-ip/magento/store_name and I got an error "File not found".

I assume the second issue is due to some SEO configuration but I don't know where this could be fixed.

Someone may know of this behavior and help to fix this?


texts: Any reason why main navigation is not cached in Magento?

texts:
Is there any reason why Mage_Page_Block_Html_Topmenu block has its cache lifetime set to 0 (also holepunched in EE) ?

Adding a "active" class for "base/default" theme menu items is definitely not one as it has to be done on the theme level.


texts: Error running the `setup:di:compile` command Magento 2.3.0

texts:
Run::

/opt/plesk/php/7.2/bin/php -dmemory_limit=3G bin/magento setup:di:compile

Error screenshot::

Any one can help me


texts: Rest API doesn't set tier price by website id product is linked to

texts:
I have 2 different Magento website hosted on different servers with the identical amount of internal websites (1) and same version 2.4.2.
When sending PUT request to "rest/V1/products/tier-prices" endpoint it adds this Tier price to product, but for another website it does nothing, but gives back 200(OK) and empty array.
This is an example of Json I'm sending:
{
   "prices":[
      {
         "price":90,
         "price_type":"fixed",
         "website_id":1,
         "sku":"PRODUCT_SKU",
         "customer_group":"GOLD",
         "quantity":1
      }
   ]
}

For the second website it works ONLY if I set website_id as 0.
Product on both websites is linked to website_id -> 1

Is there a setting I'm missing or it's a Magento installation/configuration issue?

To make things worse when requesting the website product where tier prices work fine, and where website_id property was 1 it says 0. How the heck this is possible:
"tier_prices": [{
    "customer_group_id": 6,
    "qty": 1,
    "value": 90,
    "extension_attributes": {
      "website_id": 0
    }
  }]

I requested rest/V1/store/websites, rest/V1/store/storeGroups, rest/V1/store/storeViews and compared them. All is identical, only names are different


texts: Magento2 Wishlist : showing configurable parent image instead of simple product one

texts:
I want to show simple product image in whishlist listing.
As of now it show configurable image of product when added in wishlist .
I can not see any option in magento admin for same.
Please help with way for same


texts: Back end: Not able to print&send email under order 500

texts:
After installing two extensions -
S4 Customizable PDF Invoice Template
and
Fooman Email Attachments
(OK I had Aschroders SMTP Pro also before)

This happened in back end:

I can not print or send an email in ORDER view, I get 500

BUT

I CAN print AND send an email in INVOICE view

BUT whY?!

Have tried:

1) Clearing caches, reindexing, no complilation
2) installed extension to check if there is plugin conflict, there is none

one is shown resolved
Aschroder_SMTPPro_Model_Email_Queue
Fooman_EmailAttachments_Model_Core_Email_Queue  Resolved

3) We had some error messages and we raised PHP memory limit...not sure how much, but it seems to be not working or was not enough

How come this is happening? Can it still be about PHP memory limit?

If it is can it be that the limit is so high cause of "badly compatible" plugins?

But how come I get to print invoice?
Working on magento 1.9.1.1, all patches except the last small Zend patch added


texts:
I am trying to get quantity of simple products in the cart but it only returns the configurable quantity.

How can I get product simple qty in cart?

I am using this:

$session = Mage::getSingleton('checkout/session');
$cart = Mage::helper('checkout/cart')->getCart()->getQuote();

foreach ($cart->getItemsCollection() as $item) {
        if($item->getProduct()->getData('type_id') == 'simple'){
            $theqty = $this->escapeHtml($item->getQty());
        }
    }


texts:
I am looking at trying to access the country the user is accessing my site from e.g. France, Uk etc... and am looking at the best possible and most accurate way to achieve this.

I started on this problem by using $locale = new Zend_Locale(Zend_Locale::BROWSER); but that gave me en_US. Im in the UK using a virtual host (I have read up on the Zend_Locale function and now understand the reason it returns this result). I have considered some sort of HTML5 geolocation option, but if the user has javascript turned off, i'm assuming it wont work and as you can probably tell from that last comment, my Javascript is non-existent so I think thats not an option (short of spending the next few weeks or months learning a new language).

Finally I was considering using $_SERVER['REMOTE_ADDR']; then comparing the returned Ip address with some free service. However I was wondering if there is a better way in Magento, or if this way is accurate enough?

It is not vitally important that it is correct 100% of the time, however it would be nice if I can get it close to that.


texts: Add custom product attribute to Order API

texts:
I have added a custom product attribute via code, using InstallData.php
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
        $eavSetup->addAttribute(
            \Magento\Catalog\Model\Product::ENTITY,
            'hts_code',
            [
                'type' => 'text',
                'backend' => '',
                'frontend' => '',
                'label' => 'HTS Code',
                'input' => 'text',
                'class' => '',
                'source' => '',
                'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
                'visible' => true,
                'required' => false,
                'user_defined' => false,
                'default' => '',
                'searchable' => false,
                'filterable' => false,
                'comparable' => false,
                'visible_on_front' => false,
                'used_in_product_listing' => true,
                'unique' => false,
                'apply_to' => ''
            ]
        );
    }

This attribute shows in the product details page and can be set no issue. It appears in the API when fetching the product.
However, I need to add this attribute to the Order API response (http://store.test/index.php/rest/V1/orders/) but cannot figure this out at all.
I have looked up multiple examples but none of the implementations work.
So how do I go about adding this custom attribute to the Order API response, and ideally, I need to add it to the shipping_assignments.items section of the Order extension attributes


texts: Magento2 : While bind Custom knockout js to html it return only default value

texts:
/app/design/frontend/Vendor/custom_theme/Magento_CheckoutAgreements/templates/additional_agreements.phtml

I have this code inside .phtml:

  /app/design/frontend/Vendor/custom_theme/Magento_CheckoutAgreements/web/js/view/checkout-agreements.js

inside .js:

return Component.extend({
            defaults: {
                exampleMessage: 'Default Text Ready',
                sarfaraj: 'Raj',
                template: 'Magento_CheckoutAgreements/checkout/checkout-agreements'
            },

            initialize: function() {
                this._super();
                console.log(this.exampleMessage);
                this.message = ko.observable(this.exampleMessage);
                console.log(this.sarfaraj);
                this.FIR = ko.observable(this.sarfaraj);
            }
    });

  /app/design/frontend/Vendor/custom_theme/Magento_CheckoutAgreements/web/template/checkout/checkout-agreements.html

inside .html:

  My OUTPUT at Checkout page:

Help Me.
Thanks.


texts: unable to remove some codes from robots.txt

texts:
I have a weird problem. I am able to update my robots.txt however for some reason, whenever I click on www.mysite.com/robots.txt, the following code would always be at the end:

User-agent: *
Disallow:
Crawl-delay: 10

I could change any other stuff and it would show instantly. But this code at the end just appears from nowhere! I don't see it when I download the robots.txt from my file manager.


texts:
I want to add a new custom menu above the Views in the custom module.

I am creating a custom report.

Can anyone please suggest?


texts: Magento 2 Category Field in Backend empty, Index Table wrong?

texts:
I'm trying to add categories to my products via Admin UI but unfortunately, the field in the backend is empty and doesn't show my categories:

I've had this problem since some weeks, but usually it was fixed when I flushed the cache, but now I can't fix it again.

For this specific product, the database entries from the table catalog_catgory_product look like this:

When I look at the table catalog_category_product_index, the entries for this product are the following:

for every store, there's one of those entries, but all of these are with the category_id 2 instead of 7 and 9. 2 ist the "all products" category:

I guess these differences break the backend field, as it can't match the ids 2 and 7/9. What am I missing?
I already tried rebuildung the indices catalog_category_product and catalog_product_category.

Update:
Found some differences in vendor/magento/module-ui/view/base/web/js/form/element/ui-select.js:
In my local installation where everything works, the variable copyNodes in the method parseOptions() has the following format:

In my production env where it doesn't work, the same variable looks like this:


texts: Mysql state "Creating sort index" slow magento2

texts: How to disable "Creating sort index" state on mysql, this is cause high CPU(>400%) & slowing magento. How to prevent this?


texts: Product attributes Inventory change scope and add extra attributes

texts:
I want to change the scope of the product attributes of the Inventory of a product. The quantity in stock is of the GLOBAL scope. But I have different websites which have different warehouses and I'd like to have a stock per website.

I can't find the "inventory" section in the current attribute set to change the attribute's scope.

In another note, I also want to add some extra attributes to the inventory section, so I tried manually adding the "Inventory" section to the attribute set and add my created attributes there. But this just results in having 2 "inventory' tabs on the product management page.

Is there a way to access these attributes through the database to change the scope and add more attributes to the section?

I find it extremely weird that this is not possible in Magento, multistock sounds like a feature many businesses need.


texts:
I am trying to create a custom controller in magento 2.1. I have created routes.xml and namespace as

routes.xml

 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd">
        <router id="standard">
            <route id="customattribute" frontName="customattribute">
                <module name="Namespace_Modulename" />
            </route>
        </router>
    </config>

controller

namespace namespace\modulename\Controller\Searchajax;

    class Index extends \Magento\Framework\App\Action\Action
    {
        /**
         * say hello text
         */

         public function execute()
        {
            return 'Hello world!';
        }

    }

in my controller file. But I am not getting the required result. Please suggest to me a way to do this. Thanks in advance.


texts: How to refresh/flush cache automatically

texts: Every single time I am trying to upload a few photos, the Cache says "One or more of the Cache Types are invalidated: Blocks HTML output. Click here to go to Cache Management and refresh cache types." I know that you can go in and select all to refresh or flush, but if I try to go to the cache management page or any page in the website, a white page saying "This page isn’t working" pops up until I clear the cache through cpanel FTP or wait for a good few minutes to reload the page. Is there any solution to this?


texts: How to add custom page's navigation in the top main navbar?

texts: I also want to include home button at the first position of top main navigation.


texts: Customize the behavior of Magento2 grouped products

texts:
I'd like to use grouped products, to keep a series of items in one place. But I also would like the ability to select different items within the group, changing the product image and description plus attributes as the user wishes. Each one of the elements would have its own data to load, within the same grouped page. I know this is doable with custom work - I have here a link to a magento 1 site that did it: http://www.feldheim.com/kids-speak-series.html - They show the grouped products in a dropdown.

I'd like pointers into how to implement a similar idea in a magento2 website.

Alternatively, maybe I should be creating a customized product type and work from there, but how?


texts: How to link to a new CMS page from the category menu?

texts:
I created a new category and a new CMS page (with a questionnaire form) and now I would like to make it work so that when someone clicks on the category - it will NOT load the category page but instead the CMS page.

I found this:

Catalog > URL Rewrite Management > Add New URL Rewrite > then I select the category and then the page to create a Custom rewrite comes up but the "Target Path *" is grayed out with the URL of the category.

How can I make it so that the category actually redirects to the CMS page?

  Magento 1.9.1

  > Porto theme

The solution by Steven J works - thank you! The only thing to mention is - you may have to go to Custom Design and set Page Layout = 1 column. I had to do this because it threw the formating of the page off...


texts: why PRODUCT_TYPE_downloadable and PRODUCT_TYPE_bundle tags not present in catalog.xml

texts:
I'm just a beginner in magento and I was trying to figure it out that how magento handles the product display for different product types. Then I come to know about the layout system used by magento where all blocks/view are handled by xml (correct me if I'm wrong). So, for product view I'd found catalog.xml in which four blocks are there for product types

PRODUCT_TYPE_simple
PRODUCT_TYPE_configurable
PRODUCT_TYPE_grouped
PRODUCT_TYPE_virtual

My question is how these tags are selected/loaded for generating view and what happens to product type bundle and downloadable?


texts:
How to add custom decimal point validation on custom options magento

Text field Custom options Validation :
Below are the rules for this entry. Entry is limited to numerical 1-10 and a decimal character (“.”). Please let me know if you have a better way to do this:

XXX.XXXXXX (X = numerical entry) Maximum 3 digit entry before decimal and maximum 6 digit entry after decimal. Number between 001.000000 AND 166.000000 Limit


texts:
I am new to magento and don't have a magento2 directory because I installed it into public_html.

I ran bin indexer:reindex but got message -bash: bin: command not found

Please tell me how to fix this error:
"One or more indexers are invalid. Make sure your Magento cron job is running."

This confuses me
Magento Officially Doc

Thanks for your attention.


texts: How to use init() method to load order by ID?

texts:
I am trying to load sales orders via cron to then export via api I have successfully been able to load an order but I need to parse the same order_id into other methods and classes in order to get the data for payment, products etc...

I have tried to load the same order Id within another class but it doesn't work and I'd rather not have on big cron file with all of my functions inside...

Here is how I am loading an order in my Cron.php file:

$order = Mage::getModel('sales/order')->load($order_id->getOrderId());

This give me an instance of an order then in ProductData.php I would like to pass in the same order_id to get data from the order but this is where I am doing something wrong

ProductData.php

public function init($order_id){
    $this->order = Mage::getModel('sales/order')->load($order_id);
    return $this;
}

I was thinking about saving the order_id in Mage::registry but I'm NOT confident that it will always be available when the cron runs...

Can anyone help?


texts: Nginx Error Logs - 'No such file or directory' for an url that seems to load correctly?

texts:
In the course of trying to discover the cause of a sudden slow down on my Magento 1.9 hosted at Cloudways, I started examining the error logs and can't understand why there are so many 'No such file or directory' errors. When I paste the requested URL myself, I get the correct page, but the nginx log then records it as an error.

What can I infer from this? Is there an other reason for this error besides not found. For example if the database was too busy, maybe the request timed out? Not sure where to go from here.


texts:
I'm completely new to Magento (used WordPress a lot before and sites from scratch) and I cannot understand how to change the homepage so it will show the sign in page.

I'm using the standard luma theme, so there is already an existing page, I would like to redirect the controller to the sign in URL but for the life of me can't understand the architecture.

Hoping to solve this simple problem. Please help me understand Magento better.
Thanks in advance


texts: Can we uninstall multiple extensions via Magento2 component manager at the same time?

texts:
Can we uninstall multiple extensions via Magento2 component manager at same time?

NOT composer via commandline. Component manager accessed from Magento2 admin panel. There is a dropdown menu against each extension/componenet, that gives uninstall option. But you can only select 1 at a time it seems, and there is no checkbox option to select multiple.

Or do we need to uninstall them 1 by 1?

It Seems to be not having ability to select multiple extensions and uninstall at once.

I am facing the issue of dependency on each other when trying to uninstall individually.


texts:
I'm trying to get the order comment history to show on the invoice PDF.
My set up is as follows:
di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Sales\Model\Order\Pdf\Invoice" type="Denial\InvoiceComments\Model\Rewrite\Order\Pdf\Invoice" />
</config>

app/code/Denial/InvoiceComments/Model/Rewrite/Order/Pdf/Invoice.php

<?php
/**
 * Copyright Â© Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Denial\InvoiceComments\Model\Rewrite\Order\Pdf;

use Magento\Sales\Model\ResourceModel\Order\Invoice\Collection;

class Invoice extends AbstractPdf
{

    /**
 * Return PDF document
 *
 * @param array|Collection $invoices
 * @return \Zend_Pdf
 */
public function getPdf($invoices = [])
{
   echo "Model Rewrite Working"; die();
   $this->_beforeGetPdf();
    $this->_initRenderer('invoice');

    $pdf = new \Zend_Pdf();
    $this->_setPdf($pdf);
    $style = new \Zend_Pdf_Style();
    $this->_setFontBold($style, 10);

    foreach ($invoices as $invoice) {
        if ($invoice->getStoreId()) {
            $this->_localeResolver->emulate($invoice->getStoreId());
            $this->_storeManager->setCurrentStore($invoice->getStoreId());
        }
        $page = $this->newPage();
        $order = $invoice->getOrder();
         foreach ($_entity->getOrder()->getStatusHistoryCollection() as $status){
         $textChunk = wordwrap($status->getComment(), 120, "\n");
         foreach(explode("\n", $textChunk) as $textLine){
            if ($textLine!=='') {
                    $page->drawText(strip_tags(ltrim($textLine)), 35, $this->y, 'UTF-8');
                    $this->y -= 15;
            }
        }
    }
    $this->_afterGetPdf();
    return $pdf;
}

}

However I'm getting this error:
Fatal error: Class 'Denial\InvoiceComments\Model\Rewrite\Order\Pdf\AbstractPdf' not found in /home/denialuk/public_html/magento2/app/code/Denial/InvoiceComments/Model/Rewrite/Order/Pdf/Invoice.php on line 10
What silly little mistake have I made, because I can't see it!


texts: Add to cart button for upsell product in product view page not showing up magento 2.1.9

texts:
In order to show add to cart button in up sell products i have added an upsell.phtml file inside app/design/frontend/your_package/your_theme/template/catalog/product/list/

my code for upsell.phtml file is

<form action="<?php echo $this->getAddToCartUrl($_link) ?>" method="post"
id="product_addtocart_form_<?php echo $_link->getId()?>"<?php if($_link-
>getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>

<?php if(!$_link->isGrouped()): ?>
<input type="text" name="qty" id="qty" maxlength="12" value="<?php echo
($this->getMinimalQty($_link)?$this->getMinimalQty($_link):1) ?>" />
<?php echo $this->__('Qty') ?>:
<?php endif; ?>
<button type="button" onclick="this.form.submit()"><?php echo $this->__('Add to Cart') ?></button>

Unfortunately add to cart button is not showing up in upsell.phtml file. Please help me achieve this, thanks


texts: Unable to place order from Magento Admin, showing error on city field required

texts:
I am unable to place order from admin. I enter all the data in required field. When I place order, error showing in the City field - this is a required field. I am using magento 1.9.3.7 version

can anyone help me to resolve this issue?


texts:
The module code base doesn't match the DB schema and data.

Magento_Theme             schema:       2.0.1  ->  2.0.0
Magento_Theme             data:         2.0.1  ->  2.0.0
Magento_Customer          schema:       2.0.9  ->  2.0.6
Magento_Customer          data:         2.0.9  ->  2.0.6
 Magento_Cms              schema:       2.0.1  ->  2.0.0
 Magento_Cms              data:         2.0.1  ->  2.0.0
Magento_Catalog           schema:       2.1.3  ->  2.0.3
Magento_Catalog           data:         2.1.3  ->  2.0.3
Magento_Search            schema:       2.0.4  ->  2.0.1
Magento_Search            data:         2.0.4  ->  2.0.1
Magento_Quote             schema:       2.0.3  ->  2.0.2
Magento_Quote             data:         2.0.3  ->  2.0.2
Magento_Msrp              schema:       2.1.3  ->  2.0.0
Magento_Msrp              data:         2.1.3  ->  2.0.0
Magento_Bundle            schema:       2.0.2  ->  2.0.1
Magento_Bundle            data:         2.0.2  ->  2.0.1
Magento_Downloadable      schema:       2.0.1  ->  2.0.0
Magento_Downloadable      data:         2.0.1  ->  2.0.0
Magento_Sales             schema:       2.0.3  ->  2.0.1
Magento_Sales             data:         2.0.3  ->  2.0.1
Magento_CatalogInventory  schema:       2.0.1  ->  2.0.0
Magento_CatalogInventory  data:         2.0.1  ->  2.0.0
Magento_GroupedProduct    schema:       2.0.1  ->  2.0.0
Magento_GroupedProduct    data:         2.0.1  ->  2.0.0
Magento_Integration       schema:       2.2.0  ->  2.0.1
Magento_Integration       data:         2.2.0  ->  2.0.1
Magento_CatalogRule       schema:       2.0.1  ->  2.0.0
Magento_CatalogRule       data:         2.0.1  ->  2.0.0
Magento_SalesRule         schema:       2.0.1  ->  2.0.0
Magento_SalesRule         data:         2.0.1  ->  2.0.0
Magento_Swatches          schema:       2.0.1  ->  2.0.0
Magento_Swatches          data:         2.0.1  ->  2.0.0
Magento_GiftMessage       schema:       2.0.1  ->  2.0.0
Magento_GiftMessage       data:         2.0.1  ->  2.0.0

Some modules use code versions newer or older than the database.
First update the module code, then run 'setup:upgrade'.


texts: Which patches do I need to apply on Magento 1.7.0.2

texts:
The site http://fabrizioballiano.net/magento-patches/ listes for Magento 1.7.0.2 the following patches:

SUPEE-6482: SUPEE-6482 for CE 1.7.x - 1.8.0.0 (0.01 MB)
SUPEE-6285: SUPEE-6285 for CE 1.7.0.0 - 1.7.0.2 (0.05 MB)
SUPEE-6237: USPS API Patch - CE 1.6.x-1.9.x (0.01 MB)
SUPEE-5994: SUPEE-5994 for CE 1.6.0.0 - 1.9.1.1 (0.04 MB)
SUPEE-5344: Magento-CE-v1.7.x (0.01 MB)
SUPEE-1533: Magento-CE-v1.7.x (0.01 MB)
SUPEE-4291/4334: Magento-CE-v1.7.x-1.8.x (0.01 MB)
SUPEE-1868: Magento-CE-v1.7.x (0.01 MB)
SUPEE-2725: Magento-CE-v1.7.0.0-1.8.1.0 (0.01 MB)
PHP 5.4: Magento-CE-v1.7.0.0-1.7.0.2 (0.01 MB)
APPSEC-212: Magento-CE-v1.6.0.0-1.7.0.2 (0.01 MB)

This sounds a lot to me.

Is this a mistake on the site?

Which patches do I need for Magento CE 1.7.0.2 ?

Edit:
My question is related by slightly different to what are the sequence of mutliple patches apply on magento 1.7.0.2 which asks for the order of patches, but does not list all of those I found here.


texts: When we migrated to Magento 2 we found that we were unable to edit configrable products price from Admin

texts:
When we migrated to Magento 2 we found that we were unable to edit configrable products from Admin.

I want to be able to change the price.

Please tell me how to fix it.


texts: addImageToMediaGallery creates two image entries while having only one file

texts:
What I've done:

I've imported all my products once (without any problems regarding the images)
Deleted all of them and then deleted all files under media/catalog/products
imported all my products again

Now it creates two image entries in my product while only the first exists

1234.jpg (only this file exists)
1234_1.jpg (selected as default)

So i assume there is an cache, db entry, something which remembers the file which was there at some point.

Line which triggers the image import:
$this->product->addImageToMediaGallery($this->filepath, array('image', 'small_image', 'thumbnail'), true, false);


texts:
Checkout loader gets stuck while processing an order, but the order is proceeding.

I found an error in console.

I have attached an image of what is happening, and a screen grab of the javascript error presented by the console on the browser.


texts: How to show 4 product desktop view and 2 in mobile view - Magento 1.9

texts:
In rwd theme, when I show 4 products in a row by following code in catalog.xml

<action method="setColumnCount"><count>4</count></action> it looks good on desktop but on mobile view product boxes collapse in each-other.

is there any way to shows 4 products in desktop view and 2 in mobile.

Please help me to achieve this ?


texts: Product price and cart totals per tax class or customer group

texts:
I'm looking for a solution on magento 2 to get per price or per cart totals the amounts per tax class or customer group.

The case is I have extended \Magento\Quote\Model\Quote\Address\Total\AbstractTotal to have an custom fee (percentage of grand_total - shipping) (based on how to add fee to order totals in magento2) in my cart. I also have a specific customer group with tax class (no tax rule, so 0% tax) for b2b customer, removing the tax from cart.

The tax is removed from cart overview when using b2b address, but the fee is still calculated over the total + tax. Then when switching to b2c address in payment page adds the tax again, but the fee calculation is done over the total without the tax.

At the moment of fee calculation the customer group id is correctly set. Any one with a solution or point me in the right direction ?


texts: Magento 2 - Helper function to prepare data for backend multiselect field

texts:
I'm trying to use a stores allowed currencies to create a multiselect with these values for a custom module.

Now my question is, how do I best prepare the data array for the mutliselect field?

I suppose the array passed to the multiselect form has to have the following structure:

    $values = array(

        array( // option group
            'label' => 'Group 1',
            'value' =>
                array(
                    array( // Option 1
                        'value' => '1',
                        'label' => 'Option 1'
                    ),
                    array( // Option 2
                        'value' => '2',
                        'label' => 'Option 2'
                    )
                )
        ),

        array( // option group
            'label' => 'Group 2',
            'value' =>
                array(
                    array(
                        'value' => '3',
                        'label' => 'Option 3'
                    ),
                    array(
                        'value' => '4',
                        'label' => 'Option 4'
                    )
                )
        ),
    );

So for example, in my custom Class I want to return all allowed store currencies. I get the data using

$allowedCurrencies = $this->scopeConfig->getValue('currency/options/allow');

So now I need to format this into an array that can be used to create a multiselect field.

Is there a predefined helper class in Magento to prepare / format data for multiselect fields, or do I need to write this from scratch?

I know I could just output all available currencies again using the following in the system.xml

<source_model>Magento\Config\Model\Config\Source\Locale\Currency</source_model>

EDIT:

I've tried to implement David's answer below, but I have not managed. Here is my source model - as you can see I still use my own parsing hack in the getAllowedCurrencies() function.

use Magento\Framework\App\Config\ScopeConfigInterface;

/**
 * Class Config
 *
 * @package Name\MyModule\Model\Config\Backend
 */
class Config implements \Magento\Framework\Data\OptionSourceInterface
{
    /**
     * @var \Magento\Framework\App\Helper\Context
     */
    private $context;

    /**
     * @var ScopeConfigInterface
     */
    private $scopeConfig;

    /**
     * @param \Magento\Framework\App\Helper\Context $context
     */
    public function __construct(\Magento\Framework\App\Helper\Context $context)
    {
        $this->context = $context;
        $this->scopeConfig = $context->getScopeConfig();
    }

    /**
     * Get allowed currencies
     *
     * @return  array of allowed Currencies
     *
     **/
    public function getAllowedCurrencies()
    {
        $allowedCurrencies = $this->scopeConfig->getValue('currency/options/allow');
        $allowedCurrencies = explode(",", $allowedCurrencies);

        $options = [];
        foreach($allowedCurrencies as $k=>$v)
        {
            $options[] = ['value' => $v, 'label' => $v];
        }

        return $options;
    }

    /**
     * Admin Config action
     *
     * @return array
     */
    public function toOptionArray()
    {
        return $this->getAllowedCurrencies();
    }
}


texts: Install Elastic search 6+ in magento 2.3.2

texts:
I am setting Elastic Search 6+ in Magento 2.3.2 CE, but getting an issue

  Elasticsearch\Common\Exceptions\NoNodesAvailableException

I've not installed anything. I just enabled it from admin panel.
Any installation process or just enable from admin panel.


texts:
I'm playing around with custom theming, but I'm kinda stuck and I find that the front end dev guide becomes pretty unclear after you activate your theme.

So I created my own theme and activated it etc, which is nice. But now I want to create my own homepage for example, or I want to create a search result page.

How do I do this correctly?

From what I've seen I have to create my own modules per block? So for example, Hero-area_Module, content_Module, footer_module? or am I completely wrong?

I find that Mangento is so much more frustrating the Wordpress for example, so if you have really good must read tutorials (that go beyond creating a template and activating it, then doing nothing with it). feel free to link them.

Thanks!


texts:
I am trying to pull a list of sales orders updated between 2/27/2016 12:00 AM to 10/29/2016 11:59 PM. What should my URL look like? Here is what I have:

http://magentohost.com/index.php/rest/V1/orders?searchCriteria[filter_groups][0][filters][0][field]=created_at&searchCriteria[filter_groups][0][filters][0][value]=2/26/2016&searchCriteria[filter_groups][0][filters][0][condition_type]=gt&searchCriteria[filter_groups][1][filters][1][field]=created_at&searchCriteria[filter_groups][1][filters][1][value]=10/29/2016&searchCriteria[filter_groups][1][filters][1][condition_type]=lt


texts: Magento-2 SOAP API can't create customer

texts:
I am trying to create customer through SOAP API with below script. I am able to get customer details with customer id but can't create the customer.

I am getting this error "SOAP-ERROR: Encoding: object has no 'customer' property"

    <?php
    require('vendor/zendframework/zend-server/src/Client.php');
    require('vendor/zendframework/zend-soap/src/Client.php');
    require('vendor/zendframework/zend-soap/src/Client/Common.php');

    ini_set('display_errors', 1);
    $request = new SoapClient("http://127.0.0.1/magento2011/soap/?wsdl&services=integrationAdminTokenServiceV1");
    //$token = $request->integrationAdminTokenServiceV1CreateAdminAccessToken(array("username"=>"admin","password"=>"admin@123"));
    $token = $request->integrationAdminTokenServiceV1CreateAdminAccessToken(array("username"=>"soapadmin","password"=>"admin@1234"));
    //echo "<pre>"; print_r($token->result); exit;
    $opts = array(
        'http'=>array(
            'header' => 'Authorization: Bearer '.$token->result
        )
    );
    //echo "<pre>"; print_r($opts); exit;
    $serviceArgs = array("customerId" => 1);

    $customerparams = array('email' => 'customer-mail@example.org',
                            'firstname' => 'Dough',
                            'lastname' => 'Deeks',
                            'password' => 'test@123',
                            'website_id' => 1,
                            'store_id' => 1,
                            'group_id' => 1
                           );

    //echo "<pre>"; print_r($customerparams); exit;

    $wsdlUrl = 'http://127.0.0.1/magento2011/soap/default?wsdl&services=customerCustomerRepositoryV1';
    $context = stream_context_create($opts);
    try{
        $soapClient = new \Zend\Soap\Client($wsdlUrl);
        $soapClient->setSoapVersion(SOAP_1_2);
        $soapClient->setStreamContext($context);
        //$soapResponse = $soapClient->customerCustomerRepositoryV1GetById($serviceArgs);
        //$soapResponse = $soapClient->customerCustomerRepositoryV1GetList();
        $soapResponse = $soapClient->customerCustomerRepositoryV1Save($customerparams);
        echo "<pre>"; var_dump((array) $soapResponse);
    }catch(Exception $e){
        echo "Exception Error:------".$e->getMessage();
    }
?>


texts: Magento 2 Fatal error: Method Magento\Ui\TemplateEngine\Xhtml\Result::__toString()

texts:
Please check below error:

  Fatal error: Method
  Magento\Ui\TemplateEngine\Xhtml\Result::__toString() must not throw an
  exception, caught Error: Cannot use string offset as an array in
  /vendor/magento/module-ui/Component/Wrapper/UiComponent.php
  on line 0

I can  see the above error when I go to the admin > Catalog > Manage Category
and choose any category to edit.

Please help me if you face any kind of this issues?

Thanks in advance!


texts: Magento 2.0.6 admin not loading in server

texts: I have done a fresh installation of magento2.0.6 in server. At Front end the css and js are not loading also, my admin page is showing error. It says the page redirected you too many times


texts: Update composer zendframework packages to laminas

texts:
On composer outdated I found several lines similar to this

  Package zendframework/zend-view is abandoned, you should avoid using it. Use laminas/laminas-view instead.

How can I switch from zendframework to laminas?

Currently using version 2.3.4


texts: Add custom field in rss category feeds magento

texts: I want to add custom field to the description field in category feeds.


texts: How can I show the stock values of config, simple's stock (available sizes) on the catalog page?

texts:
I'm trying to figure out how to show the sizes of simple products in stock on a catalog front-end page. After getting the values I'd like to extend the catalog pages with a nice hover effect showing the available sizes for this specific product. Since this is a work in progress, please do not start about the module structure as this is a proof of concept.

So far I can show the label using the following code:

     $configurable = $_product->getTypeInstance();
     $childProducts = $_product->getUsedProducts($configurable);
     foreach ($childProducts as $child) {
     // You have a $child now
        echo $product->getAttributeText( $attribute->getLabel());
    }
    }

This would print the associated Attribute Label for this configurable product like: Shoe Sizes:

I'm able to display all the associated sizes:

    $attrs  = $_product->getTypeInstance(true)->getConfigurableAttributesAsArray($_product);
foreach($attrs as $attr) {
if(0 == strcmp("size", $attr['attribute_code'])) {
    $options    = $attr['values'];
   print_r($options);
    foreach($options as $option) {
       print "{$option['store_label']}<br />";

    }
}

This would print all configurable attribute values: 39 40 41 42 43 44 45 46 47 48 49

But I'm struggling to just show the sizes that are in stock.
The idea is to only get something like:
42 43 44
Any help would be appreciated.

See example image
https://imgur.com/a/PF8hdOf


texts: Magento2 get payment options on cart page

texts: How can i get payment methods on cart page where user can select payment option before moving to checkout page. magento2


texts: How to change Authorize.net orders to Pending instead of Processing

texts:
Under System > Configuration > Sales > Payment Methods > Authorize.net > New Order Status, the only option available creates new orders with the status of "Processing".

How can you change the status to be "Pending" or "New" instead?


texts: Transfer multi-website content between staging and production

texts:
I need to migrate some content from staging environment to production without replacing the whole database. I didn't found any tool or extension for Magento 2 that can help me resolve this issue.

I am having Magento 2 project setup on 3 different environments:

Local server - development environment (merge features to develop branch)
Staging server - develop branch
Production server - master branch

We are doing some releases (using git flow) of the code regularly but we created 2 additional websites (stores) on the staging server who are going to use new domain names. After that our client starts to create new content for the staging websites as follow:

CMS pages
CMS blocks
Widgets
New category tree
Product attributes (also add new options for some attributes)
Import products for updating some attributes

We can't switch the entire database because we are going to loose customers, orders, reports etc.

How you transfer such a content from one instance to another. I was thinking of creating module with setup script to create new websites,stores and store views but I can't put all the content in that setup.

From Magento core team still don't know the deployment steps to production server...

Check it in official docs Nothing mentioned about content migrating from one instance to another.


texts:
I need help to modify a menu.

The problem is that I want submenu to be available on one category. But on the other top menus categories they should not show in the drop down from the top menu

(I can not disable them because they are in use in the sidebar navigation).

In the menu file for my theme this is the code:

                <?php echo $_menu ?>

<?php echo $this->__('Categories') ?>

                    <?php echo $_menu ?>

I have also tried to modify Navigation.php with no success. My Magento knowledge is not 100%.

I have search forums but can not find exactly what I need. Any guidance would be appreciated.

=> EDIT:

Can it be in this file navigation.php?

    public function getCurrentChildCategories()
{
    if (null === $this->_currentChildCategories) {
        $layer = Mage::getSingleton('catalog/layer');
        $category = $layer->getCurrentCategory();
        $this->_currentChildCategories = $category->getChildrenCategories();
        $productCollection = Mage::getResourceModel('catalog/product_collection');
        $layer->prepareProductCollection($productCollection);
        $productCollection->addCountToCategories($this->_currentChildCategories);
    }
    return $this->_currentChildCategories;
}


texts: Which .Phtml Containing Home Cart Counter in magento2?

texts: I Need to find out Home cart counter section  in magento 2 ,


texts: Add custom copyright text below existing copyright text in Magento 2 frontend by module

texts:
I have attempted several steps to create a custom block to display custom copyright text below the existing default copyright in the frontend.

In my module root directory (app/code/Ciptaloka/HelloWorld/), I have these files added:

Block\Page\Footer\Copyright.php - Block file

<?php

namespace Ciptaloka\HelloWorld\Block\Page\Footer;

use Magento\Framework\View\Element\Template;
use Magento\Framework\View\Element\Template\Context;

class Copyright extends Template
{
    public function __construct(
        Context $context,
        array $data = []
    ) {
        parent::__construct($context, $data);
    }

    public function getCopyrightTxt()
    {
        return __('All products displayed on this website are manufactured by Ciptaloka.com');
    }
}

view\frontend\templates\html\copyright.phtml - Template file

    <?= $this->getCopyrightTxt(); ?>

view\frontend\layout\page_footer_copyright.xml - Layout configuration file

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

        <referenceContainer name="copyright">
            <block
                    name="ciptaloka_helloworld.footer.copyright"
                    class="Ciptaloka\HelloWorld\Block\Page\Footer\Copyright"
                    after="-"
                    template="html/copyright.phtml"/>
        </referenceContainer>

</page>

After creating those files, I tested it, but unfortunately it doesn't get displayed.

I want the frontend copyright footer to change from this:

  Copyright © 2017 Magento, Inc. All rights reserved.

to become this:

  Copyright © 2017 Magento, Inc. All rights reserved.

  All products displayed on this website are manufactured by Ciptaloka.com

My question is, can it be established by creating custom block on a custom module? If it can, and my codes got something wrong, can you point me out?

Thanks.

EDIT: My layout now looks like this, other files remain unchanged:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

        <referenceContainer name="before.body.end">
            <block
                    name="ciptaloka_helloworld.footer.copyright"
                    class="Ciptaloka\HelloWorld\Block\Page\Footer\Copyright"
                    after="copyright"
                    template="html/copyright.phtml"/>
        </referenceContainer>

</page>

But the result is not what I expected: my custom copyright is placed above the existing copyright message.


texts: How to overwrite Ahimsa\Sales\Model\Order\Email\Sender\OrderSender in M2?

texts:
I need to overwrite Ahimsa\Sales\Model\Order\Email\Sender\OrderSender just to add new methods to return payment informations, but when I put the OrderSender.php file in my custom module do not work.

I Need to overwrite this class to make some changes in new order email template. I do not want to return the payment information like a html block, I need the separate payment information.

Any help?

Tks!


texts: How to change attribute position (layered navigation) sorting based on category wise in magento 2

texts:
I want to change attribute position based on category page
means want to change custom position

here I have list of attribute

  size, color, amps, phase

for example
in category1 I want show color second number and size forth number in layed navigation
in category2 I want show color third number and size second number in navigation

I found code in vendor but no idea how to change it position based on above

vendor/magento/module-catalog/Model/Layer/FilterList.php

in this file have a function

public function getFilters(\Magento\Catalog\Model\Layer $layer)
{
    if (!count($this->filters)) {
        $this->filters = [
            $this->objectManager->create($this->filterTypes[self::CATEGORY_FILTER], ['layer' => $layer]),
        ];
        foreach ($this->filterableAttributes->getList() as $attribute) {
            $this->filters[] = $this->createAttributeFilter($attribute, $layer);
        }
    }
    return $this->filters;
}

Thanks in advance.