texts: CMS Block Widgets for Individual Products

texts:
I'm working on a CMS Block to show featured products on the home page. I set up my own template file which loads $this->getProduct() for the data.

The problem I'm having is that I'm using the catalog/product_view block type and it only loads one product, so if I repeat the widget multiple times with multiple product IDs, it will only repeat the first one (I'm guessing because the class constructor gets the product in the constructor, and Magento won't load it more than once per request)

For example, this:

{{block type="catalog/product_view" product_id="1234" template="page/html/featured/product.phtml"}}
{{block type="catalog/product_view" product_id="5678" template="page/html/featured/product.phtml"}}

When repeated twice will display the product with ID 1234 twice, using this code:

app/design/frontend/mypackage/page/html/featured/product.phtml

<?php
$p = $this->getProduct();
$img = $p->getImageUrl();
$description = $p->getShortDescription();
$name = $p->getName();
$link = $p->getProductUrl();

echo "

$name

$description

";

Is there a different block type (model) that I can use to load individual products, perhaps as a singleton? I would like to be able to get a different product for each time I call the widget using the same template to display the output. The only other option I could think of was to load a collection of a specified category in the template itself, but naturally that defeats the purpose of flexibility that the CMS offers.


texts: Counting Child Items Without Using Associated Products function

texts:
I am counting associated products to show the the number of child items on grouped product in the category page. This is however very resource intensive. Is there a better way to show the count of the number of child products?
<?php
$_productCollection = $block->getLoadedProductCollection();

foreach ($_productCollection as $_product):

    $associatedProductsCount = count($_product->getTypeInstance()->getAssociatedProducts($_product));
?>

    <?php if($associatedProductsCount):?>

<?php echo sprintf('%s Items Available', $associatedProductsCount)?>

    <?php endif;?>

<?php endforeach; ?>

Edit
I want to note that I went and tried the accepted answer in a small production environment v2.3.3 and it was about 10 times faster(I.E .0103 vs .00189 seconds) per call.


texts: Magento 2: Why does a UI Listing Component need Two Collections?

texts:
Magento 2 has a new "uiComponent" feature.  This allows to you to include a simple <uiComponent/> tag in your layout handle XML files to add things like Grids and forms to your application page.

It appears that the configuration for a data grid (a listing) requires two collection objects be configured.

What's the role of each configuration collection below?  Or do I misunderstand the roles of these collections?  Or is there a way to create grid object using only a single collection?

The following configuration sets up a UI listing Component named cms_page_listing

vendor/magento/module-cms/view/adminhtml/ui_component/cms_page_listing.xml

And the the following DI Injection tells Magento that a cms_page_listing should use a Magento\Cms\Model\ResourceModel\Page\Grid\Collection collection.

<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
    <arguments>
        <argument name="collections" xsi:type="array">
            <item name="cms_page_listing_data_source" xsi:type="string">Magento\Cms\Model\ResourceModel\Page\Grid\Collection</item>
        </argument>
    </arguments>
</type>

This seems to be the main collection used to populate the grid.

However, there's also this PageGridDataProvider in the cms_page_listing configuration.

<!-- File: vendor/magento/module-cms/view/adminhtml/ui_component/cms_page_listing.xml -->
    <argument name="dataProvider" xsi:type="configurableObject">
        <argument name="class" xsi:type="string">PageGridDataProvider</argument>
        <argument name="name" xsi:type="string">cms_page_listing_data_source</argument>
        <argument name="primaryFieldName" xsi:type="string">page_id</argument>
        <argument name="requestFieldName" xsi:type="string">id</argument>
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="update_url" xsi:type="url" path="mui/index/render"/>
            </item>
        </argument>
    </argument>

The PageGridDataProvider resolves to a virtualType

<virtualType name="PageGridDataProvider" type="Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider">
    <arguments>
        <argument name="collection" xsi:type="object" shared="false">Magento\Cms\Model\ResourceModel\Page\Collection</argument>
        <argument name="filterPool" xsi:type="object" shared="false">CmsGirdFilterPool</argument>
    </arguments>
</virtualType>

This virtual type configures a second collection (Magento\Cms\Model\ResourceModel\Page\Collection).

It's not clear why this second configuration is needed, or what its role is in creating a grid.  The higher level question is probably what role does the dataProvider play in creating a UI Grid.  The larger larger question is probably What PHP objects are created to create a UI Listing Grid, and how does a configuration control them


texts: What is the significance, or how important is Interface in Magento2

texts:
I m studying Magento2, and have reviewed one of the documentation where every design pattern which is used in Magento2 is explained with extending and Interface. Right now I only know basic of what Inreface is.

This is the tutorial I am referring to - https://www.maxpronko.com/magento-2-development-design-patterns/


texts: Create a collection of products that have a tier price for a particular customer group

texts:
I want to create a page or tab within customer dashboards that shows all products that have a tier price for a customer group they are a member of. This will help customers who have contract prices for certain products to quickly browse and add these products to cart.

protected function _getProductCollection()
{
    /** @var $collection \Magento\Catalog\Model\ResourceModel\Product\Collection */
    $collection = $this->_productCollectionFactory->create();
    $collection->setVisibility($this->_catalogProductVisibility->getVisibleInCatalogIds());

    $collection = $this->_addProductAttributesAndPrices(
        $collection
    )->setPageSize(
        $this->getProductsCount()
    )->setCurPage(
        1
    );

    $collection->addTierPrice()
          ->getSelect()
          ->where('price_index.tier_price < price_index.price');

    $collection->where(cust_group = $customerGroup);
    return $collection;
}

How is a collection like above filtered to achieve this?

UPDATE

Unsure if filtering with customer group is really necessary magento collections seem to just do this anyway as error shows when playing with these collections:

2 exception(s):
Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 3, query was: SELECT COUNT(DISTINCT e.entity_id) FROM `catalog_product_flat_2` AS `e`
 INNER JOIN `catalog_category_product_index` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=2 AND cat_index.visibility IN(2, 4) AND cat_index.category_id='2'
 INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '2' AND price_index.customer_group_id = '4' WHERE (price_index.Final_price < price_index.price) AND (cust_group =)
Exception #1 (PDOException): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 3

So I feel like i just need it to pull products that have a tier price and then it will show the products i need.

->where('price_index.tier_price < price_index.price');

The above filter works giving me the products with tier prices however this also shows the products for all groups also which i need to filter out. Something like below:

->where('price_index.Tier_price < price_index.price')
->where('price_index.customer_group_id != "ALL GROUPS"');

Upon looking at the database in the "catalog_product_index_price" price table there just seems to be a record set for each group id when all group is selected, so to solve this i think I can join this table to the 'catalog_product_entity_tier_price' table so that i can then filter out products that have the all_groups row set to 1 as this seems to have the data i need.

So i have added a join to the collection and filtered by all tier prices set to 0 to remove the tier prices for all groups:

 $collection->getSelect()->join('catalog_product_entity_tier_price as tier', 'price_index.entity_id = tier.entity_id');

 $collection->addFinalPrice()
          ->addMinimalPrice()
          ->getSelect()
          ->where('tier.all_groups = 0')
          ->where('price_index.Tier_price < price_index.price');

This seems to work perfectly allowing me to remove all products with tier prices set to "all_group" leaving just my collection of tier priced products within signed in users customer group. Feel a bit gutted i wasted the bounty now :P

SOLVED


texts: unable to get sku on product description tab

texts:
I tried to show sku on product description tab on product detail page, I put below code:

<?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), $_sku, 'sku') ?>

on catalog/customer/view/description.phtml

But it does not work.

Please check if I am missing something.


texts: How to Connect PWA to my Magento 1 site. magento 1.9

texts: Since I'm a newbie in Magento1 and also in PWA(Progressive Web App) so maybe my question is not that much good... but I just learned last night that we can connect Magento1 and also Magento2 sites to PWA for speedup.. Now I want to know that how can I connect my Magento1 site to PWA??


texts: Widget Locations & Static Blocks (not working)

texts:
As you can see in the image above I have created a widget that will display on a specific page which I defined and created the static block that the widget will load.  But I am only able to load the widget in certain Block references.

I have a sneaking suspicion that these block references are not activated in my theme.  If I am indeed right can someone please help me activate the blocks that I would like my widget to load into.  I want it to load just below the navigation but that option does not work currently.

If my suspicion is completely wrong and you have a fix for me please let me know.  Thank you - thank you - thank you, so much for any help in advance.


texts: How to move category to another parent category magento 2.1.8?

texts:
I want to move a category from parent category to another parent category.

category Drag and drop from admin is too slow. So how can I do this using code?


texts: Find duplicates in many columns query builder

texts:
I have this code to find duplicates, but i compare All columns in same row, also it returns only one row

$groupBy = explode(',',$request['fields']);
   $duplicates = DB::table($module)
    ->select('*')
    ->groupBy($groupBy)
    ->havingRaw('COUNT(*) > 1')
    ->get();

What I need is to find the duplicates with (OR) not (And)
I want to find if there's a duplicate in Name or in Phone.

I also wanted to return All of the founded recorded to determine which one should I delete.


texts:
I am using following code

RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/healthy-library

# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Now, rewrite any request to the wrong domain to use www.
# [NC] is a case-insensitive match
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{REQUEST_URI} !^/healthy-library
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

I want to skip the HTTPS redirect for this url http://www.sitename.com/healthy-library. Using the above code, it redirects to https://www.sitename.com/index.php

Any thoughts what could be wrong here?


texts: Magento : Get Sub-Categories and 8 Products From Each Sub-Category

texts:
I want to make a landing page for Magento 1.9.3.4. What I got is the following:

Head category: Computer

Sub-categories from Computer: Harddisk, Monitor, Cables, Keyboards.

I want to make a page for "Computer" where all the sub-categories will be shown and 8 products from each sub-category.

How can I do this in best way?


texts: Magento 2: Where does M2 create its aliases? uiComponent, in particular?

texts: In the Knockout/JS files, uiComponent's object is passed to the extending objects in numerous files. I'd like to have a look in the uiComponent file but I'm not sure where Magento creates its aliases to find the real name of the file.


texts:
I have created multi website in magento.

I have few questions.

1 : My client want same product in both website with same sku but different with  price and quantity. I have checked product in website view the scope of price and quantity is set to Global, how do i change same product price and quantity in multi website.

2 : I have setup onestepcheckout extension. My client want onestepcheckout in one website view and in other website they want one page checkout. I checked onestepcheckout extension in website view it scope is set to global i can't disable this extension in one website view.

3 : If I setup multi theme for multi website. In time of installing new extension , should extension files go to both theme or in base folder.

Thanks


texts:
Is there a solution to get the cart works for users browse in private mode?
From what I understood the cart works just if cookies are enabled.

Thank you for any help.


texts: Magento limit number of subcategories of a category

texts:
$load_category = Mage::getModel('catalog/category')->load($_category->getId());

$categoryChildren = $_category->getChildren();

I want only 3 subcategories, how can i do it?


texts:
I have setup multi-store magento website, also added full page caching plugin to speedup performance in front-end but still front-end is very slow.

Some reason I figured out from my analysis :

1) TTFB : time to first byte is 2-10 seconds in my magento front-end, as shown in below figure :

2) MySQL query execution time is 4-5 seconds : when I execute any simple query direct in my MySQL database then it return response in 4-5 seconds in first time, that's why any ajax taking time and return response in 4-5 seconds. My MySql setting shown as below :

Please suggest what will I do to improve magento site performance?


texts: Magento connects to wrong mongodb server

texts:
I have copied my project from production environment into dev environment and so needed to update configs to the ones used for dev environment.

I updated the  in app/etc/mongogento.xml and other config files but my Mage code still selects the production mongodb server ("dbserver:27017") instead of the dev mongodb server ("localhost:27017"). I have done a global search but I don't see "dbserver" mentioned anywhere. Tried restarting nginx abd php-fpm too to see if a value from cache is being used but i still get the same error:

Fatal error: Uncaught MongoDB\Driver\Exception\ConnectionTimeoutException: No suitable servers found (`serverSelectionTryOnce` set): [connection timeout calling ismaster on 'dbserver:27017'] in /var/www/api/vendor/mongodb/mongodb/src/functions.php:431 Stack trace: #0 /var/www/api/vendor/mongodb/mongodb/src/functions.php(431): MongoDB\Driver\Manager->selectServer() #1 /var/www/api/vendor/mongodb/mongodb/src/Collection.php(651): MongoDB\select_server() #2 /var/www/api/app/code/community/Smile/MongoCore/Model/Resource/Override/Core/Store/Collection.php(92): MongoDB\Collection->find() #3 /var/www/api/lib/Varien/Data/Collection.php(752): Smile_MongoCore_Model_Resource_Override_Core_Store_Collection->load() #4 /var/www/api/app/code/core/Mage/Core/Model/App.php(636): Varien_Data_Collection->count() #5 /var/www/api/app/code/core/Mage/Core/Model/App.php(477): Mage_Core_Model_App->_initStores() #6 /var/www/api/app/code/core/Mage/Core/Model/App.php(285): Mage_Core_Model_App->_initCurrentStore() #7 /var/www/api/app/Mage.php(627): Mag in /var/www/api/vendor/mongodb/mongodb/src/functions.php on line 431

Note that mongo db connection using MongoDB Client works properly since I am explicitly mentioning the server name like so:

$client = new MongoDB\Client("mongodb://localhost:27017");

My test code producing the error:

$root = (filter_input(INPUT_SERVER, 'DOCUMENT_ROOT'));
require $root. '/vendor/autoload.php'; // include Composer's autoloader
require_once $root . '/app/Mage.php';
Mage::app('admin');


texts: Display bundle product child items images on cart page

texts:
I want to show bundle product child items images on a cart page, in the following place:

I checked the checkout/cart/item/default.phtml, I think from following line that data is displaying :

<?php echo $_formatedOptionValue['value'] ?>


texts:
Hi guys so I've opened my list.phtml file and located the code that displays the name attribute for the products displayed in my catalog.

Could someone possible show me how they would add an extra attribute to this?

I have an attribute named Manufacturer, I'm just wondering how I can call this attribute so I don't just have the name of the product I have the manufacturer.

Any help would be great, here's an example of my code:

<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?>

                        <?php if($_product->getRatingSummary()): ?>
                        <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
                        <?php else: ?>

                        <?php endif; ?>
                        <?php
                            if ($this->getChild('name.after')) {
                                $_nameAfterChildren = $this->getChild('name.after')->getSortedChildren();
                                foreach ($_nameAfterChildren as $_nameAfterChildName) {
                                    $_nameAfterChild = $this->getChild('name.after')->getChild($_nameAfterChildName);   $_nameAfterChild->setProduct($_product);
                                    echo $_nameAfterChild->toHtml();
                                }
                            }
                        ?>


texts:
Even I follow the procedure as mentioned in magento.

Apply SUPEE-8788
To apply patch SUPEE-8788:

Open /app/etc/applied.patches.list in a text editor.
Verify SUPEE-8788 is not applied. If it is, and it's version 1, see Replace SUPEE-8788 version 1 with version 2.
Verify whether or not patch SUPEE-1533 is applied. If it is, and your Magento version is earlier than EE 1.14.1.0 or CE 1.9.1.0, revert
SUPEE-1533.
If your Magento version is earlier than EE 1.14.1.0 or CE 1.9.1.0, and SUPEE-3941 is not applied, apply SUPEE-3941.
Get version 2 of SUPEE-8788.
Apply version 2 of SUPEE-8788.

I followed same procedure to my project. I am using magento 1.7.0.2.
When installing Security Patch SUPEE 8788, I am getting the following issues
checking file app/code/core/Mage/Adminhtml/controllers/IndexController.php
Hunk #1 succeeded at 373 (offset -19 lines).

checking file app/code/core/Mage/Wishlist/controllers/IndexController.php
Hunk #1 FAILED at 48 (different line endings).
Hunk #2 FAILED at 152 (different line endings).
Hunk #3 FAILED at 162 (different line endings).
Hunk #4 FAILED at 192 (different line endings).
Hunk #5 FAILED at 212 (different line endings).
Hunk #6 FAILED at 337 (different line endings).
Hunk #7 FAILED at 393 (different line endings).
Hunk #8 FAILED at 412 (different line endings).
Hunk #9 FAILED at 428 (different line endings).
Hunk #10 FAILED at 447 (different line endings).
Hunk #11 FAILED at 536 (different line endings).
Hunk #12 FAILED at 632 (different line endings).
Hunk #13 FAILED at 641 (different line endings).
Hunk #14 FAILED at 663 (different line endings).
Hunk #15 FAILED at 719 (different line endings).
15 out of 15 hunks FAILED

checking file app/design/frontend/base/default/template/catalog/product/view.phtml
Hunk #1 FAILED at 40 (different line endings).
1 out of 1 hunk FAILED

checking file app/design/frontend/base/default/template/persistent/customer/form/login.phtml
Hunk #1 FAILED at 38 (different line endings).
1 out of 1 hunk FAILED

checking file app/design/frontend/base/default/template/wishlist/view.phtml
Hunk #1 FAILED at 52 (different line endings).
1 out of 1 hunk FAILED

checking file js/mage/adminhtml/uploader/instance.js
can't find file to patch at input line 7570
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git lib/Unserialize/Parser.php lib/Unserialize/Parser.php
|index 423902a..2c01684 100644
|--- lib/Unserialize/Parser.php
|+++ lib/Unserialize/Parser.php
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
can't find file to patch at input line 7582
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git lib/Unserialize/Reader/Arr.php lib/Unserialize/Reader/Arr.php
|index caa979e..cd37804 100644
|--- lib/Unserialize/Reader/Arr.php
|+++ lib/Unserialize/Reader/Arr.php
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
can't find file to patch at input line 7598
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git lib/Unserialize/Reader/ArrValue.php lib/Unserialize/Reader/ArrValue.php
|index d2a4937..c6c0221 100644
|--- lib/Unserialize/Reader/ArrValue.php
|+++ lib/Unserialize/Reader/ArrValue.php
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
checking file lib/Unserialize/Reader/Null.php
checking file skin/adminhtml/default/default/boxes.css
checking file skin/adminhtml/default/default/media/flex.swf
checking file skin/adminhtml/default/default/media/uploader.swf
checking file skin/adminhtml/default/default/media/uploaderSingle.swf


texts: Magento 2 configurable product without wizard

texts: Unless I am missing something I cant seem to associate existing virtual products to a new configurable product. Is this possible?


texts: Transactional email templates not loading

texts:
When I attempt to "Add New Template" for a transactional email, select a 'template' from the list, then click 'Load Template' nothing is loaded in the templtae form.  I expected there would be a template for most/all transactional mailings.

However, I'm finding that none of the 'templates' have a default template that will load into the editor.

I could have sworn I created several email messages for transactional emails this way in the past, but now no default templates will load.

This may be realted to the unanswered question here


texts: Multiple images are not uploading in the custom module

texts:
Hi I am following the solution provided here
but the multiple images are not uploading in the form.

I click on the browse button in the form, new window opens for selecting the images and when I tried to select more than one images from there, it is not happening.
It only select one image at a time. How can I select multiple option from here.

what should I do to do this correctly.

Here is my image form

<?php
class Vertax_Blog_Block_Adminhtml_Article_Edit_Tab_Image extends Mage_Adminhtml_Block_Widget_Form
{
protected function _prepareForm()
{

   $form = new Varien_Data_Form();
   $this->setForm($form);
   $fieldset = $form->addFieldset('image_form',
                                   array('legend'=>'image'));
$fieldset->addType('image', Mage::getConfig()->getBlockClassName('blog/adminhtml_article_helper_image'));
//$fieldset->addType('image', 'Vertax_Blog_Block_Adminhtml_Article_Helper_Image');

$fieldset->addField('image', 'file', array(
        'label'     => 'Image',
        'required'  =>  false,
        'name'      => 'image[]',
    'multiple'  => 'multiple',
    'mulitple'  =>  true,
    ));

if (Mage::getSingleton('adminhtml/session')->getBlogPostData()) {
        $form->setValues(Mage::getSingleton('adminhtml/session')->getBlogPostData());
        Mage::getSingleton('adminhtml/session')->setBlogPostData(null);
    } elseif (Mage::registry('article_data')) {
        $form->setValues(Mage::registry('article_data')->getData());
    }
    return parent::_prepareForm();
}
}
?>


texts:
I'm trying to fix the error

Fatal error: Call to a member function getBackend() on a non-object in Abstract line 514

Because i cant enter my manage customers in the backend

I did a trace and it shows me this :

Mage registry key "original_include_path" already exists

Anyone knows what is going wrong here and knows a fix?


texts: Update customer's custom attribute pro-grammatically in magento 2

texts:
I am using following extension:
https://github.com/diglin/Diglin_Username2

The custom attribute 'username' is created and working fine during login.

But I need to update this attribute value along with other customer data programaticaly. But when I save customer, this attribute is emptied. Please suggest some solution.

Here is the code:

$customer = $objectManager->get('Magento\Customer\Model\Customer')->setWebsiteId($websiteId)->loadByEmail($email);
if(!$customer->getId()){
$customerFactory = $objectManager->create('Magento\Customer\Model\CustomerFactory');
$customer = $customerFactory->create();
$customerModelData = $customer->getDataModel();
$customerModelData->setCustomAttribute('username',$customerData['web_username']);
$customer->updateData($customerModelData);
$customerResource->saveAttribute($customer, 'username');
}

$customer->setStoreId($storeId);
$customer->setWebsiteId($websiteId);
$customer->setEmail($email);
$customer->setFirstname($customerData['first_name']);
$customer->setLastname($customerData['last_name']);
$customer->setGender($gender);
$customer->setGroupId($groupId);
$customer->setPassword($this->magentoPassword);
$customer->save();

Thanks in advance!


texts:
I would like to explain our release management system for Magento 2 briefly. Then I am going to ask how to improve it.

We are using git flow for our release management. Our work flow is generally like the following:

Create a new branch for a new feature
Send a PR, and wait others to approve the PR
Merge the feature branch with develop branch
Test the feature on the develop branch

If tests don't fail then create a new release in git.

Finally, use git checkout -f {RELEASE_TAG_NUMBER} to activate the new release.

As a result, we have a lot of release tags, such as 1.0, 1.2, ..., 3.41.

These steps are great if you did not change anything on the database. For example, we have updated a module in the latest version. If I rollback to previous one, then I got the following error message:

Magefan_LoginAsCustomer schema: current version - 2.1.3, required version - 2.1.1
Magefan_LoginAsCustomer data: current version - 2.1.3, required version - 2.1.1

It is happening because, Magento expects Magefan_LoginAsCustomer to be in version 2.3.1. The version in the code and database does not mach.

Question 1: When I rollback to previous version in code, how can I also roll-back the database?

This issue can get even worse with a change in database schema.

Question 2: Is there a way to roll-back code and database simultaneously?

Question 3: How do you manage your releases?


texts: Change Row Total for Quote Item whithout changing the Price

texts:
I have tried to set custom price for this purpose but its getting multiplied by quantity. All i need to add an extra ammount(like 50$) to each quote item after its added too the cart.
So it will be like this if have 2 products in cart..
First product Price 5.00$ qty is 10.
Second Product Price 3.50$ qty is 20.

I want the calculation be like : (5.00 * 10 + 50) + (3.50 * 20 + 50)
item 1 subtotal = 100.
item 2 subtotal = 120.
Total = 220.

For Magento 1 it was implemented in Sales_Quote_Item model
in CalcRowTotal().
like this..
$baseTotal = $this->getBaseRowTotal() + $additionalCharges;

    $baseTotal = $this->getBaseRowTotal() + $additionalCharges; //$additionalCharges is the custom value that i want to add.
    $total = $this->getStore()->convertPrice($baseTotal);
    $this->setRowTotal($this->getStore()->roundPrice($total));
    $this->setBaseRowTotal($this->getStore()->roundPrice($baseTotal));

But in Magento 2 this is not working . Can anyone Help ??


texts:
Normally I would get a Magento order info (like Tax) in this way:

$order = Mage::getModel('sales/order')->loadByIncrementId($set['order_id']);
echo $order->getShippingTaxAmount();

But for Ebay orders I am not able to see the M2E Order Information in the Order Object, specifically the Tax.

In the Admin area I need to click on "Show Ebay Order" to see the Tax, but i need to write a report that needs this value. Does anyone know how to retrieve the M2E Ebay Order information programmatically?

Thanks

UPDATE

this is what I needed:

$ebay_order = Mage::getModel('M2ePro/Ebay_Order')->load('41289');
$tax = $ebay_order->getTaxDetails();

UPDATE 2

For those in cases where you only have the increment_id for the Magento Order. You will need retrieve the ChannelOrderId first then filter the collection by ebay_order_id

See my example below:

$order = Mage::getModel('sales/order')->loadByIncrementId($increment_id);

$paymentInfo = Mage::helper('payment')->getInfoBlock($order->getPayment())->setIsSecureMode(true);
$channelOrderId = $paymentInfo->getChannelOrderId();

$ebay_order = Mage::getModel('M2ePro/ebay_order')->getCollection()
          ->addFieldToFilter('ebay_order_id', $channelOrderId)
          ->getFirstItem();

$tax = $ebay_order->getTaxDetails();

echo '
';
print_r($ebay_order);
echo '
';

echo '
';
print_r($tax);
echo '
';


texts: How to make css file to include in email template magento 2.3.3

texts:
I want to write certain css for my email templates.
How can i do that.
Please tell me how should i make a custom css file for email templates and include it in my email template content https://prnt.sc/10ov9rl


texts: Magento2 echo current year/month as custom variable?

texts:
Looking for a way to echo the current day of week, month, and/or year as a custom variable? Can this be done? I want to add it to a CMS page as a text so that in other words, if I say:

"Looking for the hottest {{CustomVar code= "year"}} tshirt designs anywhere?" it would appear on the front end as "Looking for the hottest 2019 tshirt designs anywhere?" as of today.

I know I would create a variable with the code "year" but I've tried:

,

in the HTML section and it does not generate the year.

Any other suggestions? THANK YOU!


texts: Difference between Sales order and database

texts:
In Magento 1.9 when generating a Sales order report (Report -> Sales -> Orders) for February I expect the same value total in invoiced column compared to running below:

select sum(base_total_invoiced), day(created_at) as dag from sales_flat_order where state ='complete' and created_at between '2019-02-01 00:00:00' and '2019-03-01 00:00:00' group by dag;

However none of the days do match, which feel strange as I believe they are in the same timezone.


texts: Variable for invoice date - Magento 2.2.6

texts:
Is there a variable for the invoice date (invoice created on...) in Magento 2? I would like to add this to the standard template for invoice pdfs.

Thanks in advance!


texts: Hide Authorization Token from Request Headers in browser for headless magento 2

texts:
We are using reactJS as frontend for magento 2 website using magento 2 rest APIs. But the authorization token is visible in the browser dev tools posing security risk.

Kindly suggest a way to hide authorization token from browser.

Also we want to block API hits from any other tool (e.g. postman,arc etc.) and allow API hits only through reactJS end.


texts: Remove blank option from country dropdown list

texts:
To generate country drop down list Mage::getBlockSingleton('directory/data')->getCountryHtmlSelect() method is responsible but generated drop down has blank entry at the top along with all other countries.

How to remove this blank entry from country drop down list?


texts:
I want to change the default max size of images defined in

vendor/magento/framework/File/Uploader.php

In that file the size defined 1920x1200
I want to reduce that and want to override it.
where I can put this file in my custom theme or module.


texts: How to override class which extends Abstract Class

texts:
I want to override a class Magento\Catalog\Model\Product\Type\Simple

  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\Catalog\Model\Product\Type\Simple"
                type="<vendor_name>\<module_name>\Model\Product\Type\Simple"/>
</config>

I override and added one function :

<?php
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace <vendor_name>\<module_name>\Model\Product\Type;

/**
 * Simple product type implementation
 */
class Simple extends \Magento\Catalog\Model\Product\Type\Simple
{

    /**
     * Attribute collection factory
     *
     * @var
     * \Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Attribute\CollectionFactory
     */
    protected $_attributeCollectionFactory;

    /**
     * @codingStandardsIgnoreStart/End
     *
     * @param \Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Attribute\CollectionFactory $attributeCollectionFactory
     *
     * @SuppressWarnings(PHPMD.ExcessiveParameterList)
     */
    public function __construct(
        \Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Attribute\CollectionFactory $attributeCollectionFactory
    ) {
        $this->_attributeCollectionFactory = $attributeCollectionFactory;
    }

    /**
     * Retrieve configurable attribute collection
     *
     * @param \Magento\Catalog\Model\Product $product
     * @return \Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Attribute\Collection
     */
    public function getConfigurableAttributeCollection(\Magento\Catalog\Model\Product $product)
    {
        return $this->_attributeCollectionFactory->create()->setProductFilter($product);
    }
}

But it cause fatal error while I tried to add product in cart as below:

  Uncaught Error: Call to a member function dispatch() on null in .../vendor/magento/module-catalog/Model/Product/Type/AbstractType.php:602

I add getConfigurableAttributeCollection function because when I load product collection of ordered Items including configurable Items it throw error like :

  undefined getConfigurableAttributeCollection()

So I added this function into Sample.php

But no luck, Any Suggestions would be appreciated.


texts: Search catalog and list products from a single store

texts: I am trying to filter the products of a category, I talk about the catalog search, I'm working in a multi-store and I need to filter only the products in the catalog of a store. I filter this in the model.


texts: I am using Magento 1.9 and am required to add an image to the minicart underneath the sub total section, I am working as an apprentice so I'm pretty new to all of this, any help would be greatly appreciated. Thanks


texts: I've read the M2 article (https://devdocs.magento.com/guides/v2.4/extension-dev-guide/async-operations.html) and I understand what it does, but how? PHP has a single thread, but it looks like we defer some operations. I'm trying to understand how it works. I guess one of the ways of doing so is to use RabbitMQ with an RPC pattern. Please explain in detail how is it done.


texts: Magento 2: How can i change page layout using Block file

texts:
I need to change search page layout 1-column while Search page is empty.
any idea please share.


texts: I enable PayPal express checkout extension in magento2 and place order everything working fine but I have some products which have subscriptions. I want if someone adds subscription product in cart it product deal as a subscription.


texts:
I am using Magento 1.7.

In the page myUrl/customer/account, I created a table that shows the amount of each product that was ordered in the last orders. The first column contains the product name, the last column contains a link for buying the product again, and the columns in the middle contain the amount of product ordered for each one of the last orders.

In recent.phtml, under app/design/frontend/default/CUSTOM_THEME/template/sales/order, I obtained the names of the products as follows (snippet of the code):

<?php $_orders = $this->getOrders();
    foreach ($_orders as $_order)
    {
            $items = $_order->getAllVisibleItems();
            foreach($items as $item)
            {
                $name = $item->getName();
                (...)
            }
    }
?>

And I obtained the add to cart URL as follows:

<?php
    $product = Mage::getModel('catalog/product')->loadByAttribute('name',$name);
    $addToCartURL = Mage::helper('checkout/cart')->getAddUrl($product);
?>

But this URL is not adding the product to the cart, it only redirects to the product page.

I found that in the product page the add to cart button that is actually working, has this code:

<button type="button" title="Agregar al carrito;" class="button btn-cart" onclick="productAddToCartForm.submit(this)">
        Agregar al carrito;
</button>

I am also able to obtain the simple products instead of the configurable ones, in case this is needed.

My question is, how can I insert a button/URL in the last column of my table so that when I click on it the product gets added to the cart. Any help is much appreciated.


texts: Amazon Pay ignores javascript mixins from other modules

texts:
When using Amazon Pay during the checkout process, seemingly any module that uses Javascript mixins to capture additional fields from the checkout page and pass them to the POST request for processing get skipped, resulting in the data never being sent to the server for processing.

For example, we're in the process of installing the GDPR module from Plumrocket and testing it on our development site.  We've added a Consent Checkbox for the Privacy Policy to the checkout process.  This adds a little checkbox just bellow the payment method to accept the Privacy Policy.  If it's not checked, it won't let you click the checkout button.  But when you check it and hit submit there's a server side check for the box, and that is throwing an error because the checkbox is never sent through the payment[extension_attributes][consent_ids] key during the POST.

So I opened up the console and started throwing some breakpoints in the javascript.  And from what I can tell, none of Plumrocket GDPR's mixins get ran after hitting the submit button.  In contrast, they work just fine when using PayPal, Auth.net/Credit Card, or Gift Card payment methods.

Now, I know what you might be thinking, that "It's probably just an issue with GDPR.", but we have another website where we are setting up Amazon Pay and it's causing issues with another module that tries to capture additional fields in the payment[extension_attributes] key.

This module adds a text box to capture a Delta SkyMiles account number and was built mostly following this stack answer.  It's a pretty straight forward little module that does what it needs to do and like the GDPR, works on every payment method except Amazon Pay.  And just like the GDPR, none of the mixins run, and the field ultimately is not added to the payment[extension_attributes] key during the POST.

So, my hope here is that someone has some insight as to what might be happening here.  Because I'm at a loss at this point.  This does not seem like the behavior I would expect from a proper payment method.

Edit 9/25

I've learned after some testing that this only happens to JS mixins applied to the payment_methods section of the checkout and are acting on Magento_Checkout/js/action/place-order.  We recently added a checkbox to the shipping_methods section of checkout that acts on Magento_Checkout/js/action/set-shipping-information and that one works fine when using Amazon Pay and the checkbox is properly captured for the order.


texts: Remove street address label and * from required

texts:
I'm trying to remove the street address label in checkout.

I'm using this:

unset($jsLayoutResult['components']['checkout']['children']['steps']['children']['shipping-step']['children']['shippingAddress']['children']['shipping-address-fieldset']['children']['street']['label']);

And the text in the label gets removed the but red star * from required stays in the ::after in the label. How do I get rid of the star?


texts:
I have a custom theme (rwd set as parent theme), in mobile view I want to disable gesture zoom through out the site. For this I have below code in head.phml

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

I also tried adding below code

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />

But none of the above seems working, anyone has idea how to disable gesture zoom?


texts: Column not getting updated in production but works fine in Test

texts:
I have a magento site and a MYSQL table where sellerprofile is saved. I manually added a column to this table

ALTER TABLE `XYZ` ADD COLUMN `ABC` AFTER `CDE`

Now when I am trying to update a value to this column using my magento code then it is not saving this value. If I try to do a SQL update then it works just fine.

The Magento update

$collection->save()

does not return any error either. All other columns get updated except this particular column. I did a Mage::log on this and till the save point, the variable does carry the correct value. It just does not show up in the database.

Strangely this works perfectly in my TEST env which is not very different from PROD.

What am I missing here?


texts: how to enable font-family tool in WYSIWYG editor in magento 2

texts: i want display fontfamily in the wysiwyg editor in magento2


texts:
How can I customize price filter Magento to be based on associated product prices rather than configurable product prices?

In my category page display configurable product with its options. On this page price filter is working fine

I want to filter not using configure product price but using simple product prices which are added as associated products.

Thanks in advance.


texts: M2 - one frontend for one store in routes.xml

texts:
How can I have multiple route available for one module but different store ? I have one module that is going to be used for several stores (us / de / fr etc..)
I would like to have something like :

https://mysite/hello_world for the US store

https://mysite/bonjour for the French store

BUT I don't want to have the hello_world available for the French store neither the bonjour for the US store.

How can I do that ? I already found this : How to define multiple routes in single module So in routes.xml I can set multiple frontend route but I can not defined the store.
So how can I have one frontend for one store in routes.xml ?


texts: Magento 2.2.5 - JS errors in console only on Hard Fresh(Ctrl+F5)

texts:
The above issues occur only on hard refresh(Ctrl+F5) and not on normal refresh(F5).

Can anyone help me to fix this?


texts:
The majority of our customers enter a search on the homepage of our site.

Let's say user1 enters search123.
& User2 enters mysearch789

Is it possible when the customer reaches the product list and product page that the product can show

For User1 = (product name) - search123

For User2 = (product name) - mysearch789

It's a custom search we have on our homepage that returns values from an external source. I was looking for the products in the Magento db to have the value returned from the external db appended to the title in website. This would be different for every customer.


texts: Product collection to get canonical product url By cron process

texts:
its really strange to get such kind of issue relate to get product correct url

below is my collection to get product information

    $store = Mage::app()->getDefaultStoreView();
    $rootCategoryId = $store->getRootCategoryId();
    // Gets the current store's id
    $storeId = $store->getStoreId();

  $collection = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*')
                  ->addStoreFilter($storeId)
                   ->addAttributeToFilter(
                    'entity_id',
                        array('lt' => 2500)
                  )
                  ->addAttributeToFilter(
                    'entity_id',
                        array('gt' => 2100)
                  )
                  ->addAttributeToFilter(
                    'status',
                        array('eq' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED)
                  )->addUrlRewrite($rootCategoryId);

when i will run this process by CLI ( means any php file to call this collection its given my correct url of product

but problem is occurred when this collection is called by any cron process with cron_schedule table

i am getting below url

http://www.anydomain.com/index.php/catalog/product/view/id/2107/s/product-url

by i need only

http://www.anydomain.com/product-url

above result is working fine with any CLI (means with php file to call this collection)

but its not working with Cron process.

would you please help me to get it done.any suggestion would be appreciate.


texts:
I am facing an error while running command

bin/php magento setup:upgrade

It return the error shown below:

  [Magento\Setup\Exception] Database user does not have enough privileges. Please make sure SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER privileges are granted to table 'magento_latest'.


texts:
Using the standard / included Braintree payment method - i get the following error on Safari console when at the Checkout page for payment.
The payment method is not shown on checkout, the others are (i.e paypal, cheque etc)

[Error] TypeError: undefined is not an object (evaluating 'this.messageContainer.addErrorMessage')

initObservablecc-form.js:159

initObservable
(anonymous function)
initialize
(anonymous function)
_super
initialize
(anonymous function)
_super
initialize
(anonymous function)
constr
initComponent
fire
fireWith
(anonymous function)
fire
fireWith
(anonymous function)
(anonymous function)
execCb
check
(anonymous function)
(anonymous function)
(anonymous function)
each
emit
check
(anonymous function)
(anonymous function)
(anonymous function)
each
emit
check
(anonymous function)
(anonymous function)
(anonymous function)
each
emit
check
(anonymous function)
(anonymous function)
(anonymous function)
each
emit
check
enable
init
callGetModule
completeLoad
onScriptLoad

What I have tried:

Apache, Ngnix, Litespeed webservers
PHP7.0.* & 5.6.16+

The only time I have had it working was using apache+php5.6.18 using mod_php but never using FPM; Never had php70 working with it regardless of install type.

It seems like it wants to throw and error on screen but can't ?

Has anyone had any success with Braintree payment method? Did you encounter this error? IF so did you get around it?


texts: Do not display out of stock products in reorder admin panel

texts: I don't want to show out of stock products in admin panel reorder or create new order option.


texts: Restore Backup of Magento 2 on AWS Stack

texts:
Deployed Magento 2 site on AWS using AWS CloudFormation Template.

We have a backup of the running site of Magento 2 which is currently running on a single VM (MySQL and Webserver).
while trying to restore the backup from running site to new AWS Stack, it shows "The rollback file is invalid. Verify the file and try again."

I have copied the backup into /var/www/html/var/backups

Do I need to register it somewhere for Magento to identify it as a Magento backup?

Found a difference of backup filename prefix as below,

-rwxrwxrwx 1 nginx nginx    878119 Apr  9 08:11 1586419820_db.sql
-rwxrwxrwx 1 nginx nginx  48366101 Apr  9 08:12 1586419915_media_Test.tgz
-rwxr-xr-x 1 nginx nginx 139980273 Apr  9 09:01 1586350293_media_backup.tgz

15864 is the backups generated from magento admin console (AWS), 15863 is from our running Magento.

Please help!!!


texts:
I'm trying to add a standard widget from within WYSIWYG Editor, but it does not work, because only the image is shown.

In the editor <p>{{widget type="Magento\Cms\Block\Widget\Page\Link" anchor_text="bar" title="goo" template="widget/link/link_block.phtml" page_id="3"}}</p>

Is this a bug or am I missing something obvious?
Still no solution found..
Thanks


texts: How to show tier price in a configurable produtct in Magento 2 product list?

texts:
I added the product tier_price below the product price on the catalog page, like this:

But I noticed that when it is a configurable product, composed of other simple products, tier_price does not appear. My question is: how to show tier price in a configurable produtct in Magento 2 product list (aka. catalog price)???


texts: Magento-2-Paypal orders not showing in magento end?

texts:
In Magento-2 when we place order through paypal payment method then payment successful at paypal end and all data related to transaction display perfect but when we look in magento admin the order data of those orders do not show.
It happens not for all paypal orders having for random orders.
Please suggest what we should do in this case.

Main error : order ID is incorrect. Verify the ID and try again. {"exception":"[object] (Exception(code: 0): The "50012081" order ID is incorrect. Verify the ID and try again. at vendor/magento/module-paypal/Model/Ipn.php:146)"

what i have done so far :
Enabled Paypal debug mode on.
Checked all log SetExpressCheckout,getExpressCheckout and DoExpressCheckout reponses are showing success acknowledgement.


texts: magento 2: Products not adding to minicart but showing in /checkout/cart via ajax call api

texts:
I have integrated a 3rd party service api chatbot- basically to assist users online via chat, where the users can request for trending products, today's deals etc.
I have a situation: When i add product to shopping cart via the 'chat bot service api', the products does not show up in the minicart (even after refresh, clearing cache and running content deploy command), but when i navigate to /checkout/cart, there the products shows up.
Only if I logout and login for the same user, then the products can be seen in the minicart, for the current session it is not showing
But with normal magento - adding products to shopping cart, there products are adding to minicart.
Can anyone pls suggest how to proceed.
Im not using any custom module for this chatbot, its only an api call.
So far debug done on:

Tried to move the !_.isEmpty(storageInvalidation.keys()) condition outside else as suggested here https://github.com/magento/magento2/issues/5946
Not sure if i have to change all this as suggested here: https://github.com/magento/magento2/commit/eec3cf17bc5deae71c83c797d1339de46cf6905f#diff-a64661f242d03f8ebbcfdcf080d29e7c


texts: Redirect/rewrite home page domain.com to store view domain.com/en/

texts:
I have enabled Add Store Code to Urls to access the different store views of my Magento website, but now www.domain.com and www.domain.com/en/ have the same content. To avoid duplicate content I would like to redirect www.domain.com (just the home page) to www.domain.com/en/.

How can I achieve this by using .htaccess or any other intelligent method? Thank you.


texts: Not getting order details on onestep checkout page

texts:
I am trying to get order details on onestep checkout but its not working. My xml code is like this :

<checkout_onepage_controller_success_action>
                <observers>
                    <pmembers_invoicer_automatically_complete_order>
                        <class>MKD_Pmembers_Model_Observer</class>
                        <method>CompleteOrder</method>
                    </pmembers_invoicer_automatically_complete_order>
                </observers>
            </checkout_onepage_controller_success_action>

My observer code is follow:

 $_order = $observer->getEvent()->getOrder();
            $order =$observer->getEvent()->getOrder();
             $oid = $order -> getId();

It give Fatal error:  Call to a member function getId() on a non-object. Am I doing something wrong. I want to make some changes on payment made. I know some uses sales_order_payment_pay for payment verification.


texts: Same content (language) for multiple countries (store views)

texts:
I'm trying to implement an e-commerce site (using Magento 2) that has the following requirements:

be available in N countries (eg http://example.com/country_code/ )
with X languages
share the same price
Currency changes depending on the selected country

The initial idea is to create 1x website with 1x store with N store-views

However, I wanted to reuse the content in countries that share the same language base (eg: English in the US and UK)

It becomes impracticable to add or change the same content to several different store-views.

Do you know the best Magento practice to handle this issue, or if there is a module from a Magento partner to manage a multi-locale and multi-language store?

Thank you


texts: Solved: How to make category attribute saved store wise in Magento 2.3.3, not only global?

texts:
How can I make custom category attributes being saved in to different store views, in Magento 2.3.3, and not only global?

Change 'global' => 1  to 'global' => 0 doesn't seem to make any difference.

use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Eav\Setup\EavSetupFactory;

class InstallData implements InstallDataInterface
{

    private $eavSetupFactory;

    /**
     * Constructor
     *
     * @param \Magento\Eav\Setup\EavSetupFactory $eavSetupFactory
     */
    public function __construct(EavSetupFactory $eavSetupFactory)
    {
        $this->eavSetupFactory = $eavSetupFactory;
    }

    /**
     * {@inheritdoc}
     */
    public function install(
        ModuleDataSetupInterface $setup,
        ModuleContextInterface $context
    ) {
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

        $eavSetup->addAttribute(
            \Magento\Catalog\Model\Category::ENTITY,
            'custom_category_field',
            [
                'type' => 'varchar',
                'label' => 'Category Custom field',
                'input' => 'text',
                'sort_order' => 100,
                'source' => '',
                'global' => 1,
                'visible' => true,
                'required' => false,
                'user_defined' => false,
                'default' => null,
                'group' => 'General Information',
                'backend' => ''
            ]
        );
    }
}

EDIT

Working example efter help from @Haijerome

$eavSetup->addAttribute(
            \Magento\Catalog\Model\Category::ENTITY,
            'category_heading',
            [
                'type' => 'varchar',
                'label' => 'Category Heading',
                'input' => 'text',
                'sort_order' => 100,
                'source' => '',
                'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
                'visible' => true,
                'required' => false,
                'user_defined' => false,
                'default' => null,
                'group' => 'General Information',
                'backend' => ''
            ]
        );


texts:
We bought extension from WebShopApps for Address Validation. When customer change address on checkout extension send request to Fedex for validation address. It take all accesses from Fedex section. This access work fine for getting shipping rates, but when WebShopApps send request for address validation it get this response:

"[Message] => Authentication Failed"

What could be the problem and how to solve it?


texts: Get Guest firstname and lastname from Order

texts:
In Magento guest checkot we must fill firstname and lastname, and i want to retrieve guest firstname and lastname from order, i tried to do it like this:

$name = $order->getCustomerName();

but when i print the $name it shows guest not the guest firstname or lastname


texts: Fail to load custom attribute in phtml: Undefined variable: _product

texts:
I want to display a content of attribute into a new block in product VIEW page. My code is simple:

<?php
echo $_product->getIncommTermos() ;
?>

this get me error Notice: Undefined variable: _product  on line 2. This file is  a new phtml inside my template/folder/termos.phml and not recognized the variable _product, why? thanks


texts:
i tried to create menu and items under it  but nothing appeared and no errors in log

the folder structure

app\code\community\shopsense\shopstyle\Block
app\code\community\shopsense\shopstyle\controllers
app\code\community\shopsense\shopstyle\etc
app\code\community\shopsense\shopstyle\Helper
app\code\community\shopsense\shopstyle\Model
app\code\community\shopsense\shopstyle\sql

and my config.xml,path

  app\code\community\shopsense\shopstyle\etc\config.xml

<config>
    <modules>
        <shopsense_shopstyle>
            <version>0.1.0</version>
        </shopsense_shopstyle>
    </modules>
      <global>
        <helpers>
            <shopsense_shopstyle>
                <class>Shopsense_Shopstyle_Helper</class>
            </shopsense_shopstyle>
        </helpers>
    </global>

</config>

and shopsense_shopstyle.xml,

  path app\etc\modules\shopsense_shopstyle.xml

<config>
    <modules>
        <shopsense_shopstyle>
            <active>true</active>
            <codePool>community</codePool>
        </shopsense_shopstyle>
    </modules>
</config>

  app\code\community\shopsense\shopstyle\etc\adminhtml.xml

<config>
    <menu>
        <shopsense  module="shopsense_shopstyle">
            <title>shopsense</title>
            <sort_order>1</sort_order>
            <children>
                 <items module="shopsense_shopstyle">
                    <title>Example</title>
                    <sort_order>1</sort_order>
                    <action>adminhtml/shopstyle/index</action>
                </items>
            </children>
        </shopsense>
    </menu>

</config>

and here is helper code

  path app\code\community\shopsense\shopstyle\Helper\Data.php

<?php
class Shopsense_Shopstyle_Helper_Data extends Mage_Core_Helper_Abstract{

}

//end of the file


texts: Magento 2 - Data migration tools and new products migrate from Magento1

texts:
A month ago I created a new website with Magento 2 and I used the data migration tools to migrate the old website from Magento 1.

Since then the old Magento1 website has added new products to the store and now I need to insert these new products into my new Magento 2 store, plus I need to update the already existing products.

Data migration tools don't let me do that, I've tried exporting/importing from Magento 1 and Magento 2 core but it doesn't work.

Is there a way to do migrate product from Magento1 to Magento2?

Any advice, please let me know?


texts: Layered navigation only for subcategories in home page

texts:
I have these sub-categories under books category.

I have tried adding this code to my home page as described in here Magento 2 How to show Layered Navigation on home page? . But it shows only price.

I need to show these subcategories in the home page as a list and navigate to the relevant books when clicking on it.
How can I do this by customizing the CMS rather doing code modifications ?


texts: Static files in developer mode, is it normal?

texts:
Note : I am in developer mode.

Is it normal that my CSS files are loading as static files?

I know it can be a stupid question, but i need to understand.


texts: Payment gateway status set to pending magento 2.1.1

texts:
I use sample-module-payment-gateway to test a payment gateway in magento 2, as i find out the order status is set to processing.

My question is how can i set this to pending, when a new order is placed?

I found a lot of tutorials about Magento-1. But not for Magento-2.


texts: There was an error loading payments.Please refresh or try again later. PWA Venia Theme Magento2.4 issue coming on

texts:
I have installed PWA Venia Theme with magento2.4.1 EE but on checkout, no payment methods are loading.
Error Getting: There was an error loading payments. Please refresh or try again later.
Attached the image below Is anyone faced the same issue? or anyone has any information regarding this issue?


texts: Paypal Payments Pro - Transfer Shopping Cart Line Items?

texts:
I am using Paypal Payments Pro in Magento 2.3.1. I have Paypal Express checkout enabled as an alternate checkout option.

First of all, let me clarify that both payment options are working just fine - the transactions go through, and the orders are being properly received and created in Magento.

That said, with express checkout there is an option in the configuration to enable "Transfer Cart Line Items". When set to "Yes" this works as expected and the item details (Product name and sku) are transferred to Paypal and show on the Paypal transaction details.

Orders placed with a credit card (through Payments Pro) however, do not show the product details (Product name and Sku) on the Paypal transaction details.

Is there a setting for this? I can't find anything related to it in the configuration settings.

Any help would be appreciated!


texts:
I need to overwrite the file vendor/magento/module-customer/view/adminhtml/web/template/default-address.html. I have tried creating a custom module and adding the file in app/code/myvendor/mymodule/view/adminhtml/web/template/default-address.html but it is not working.
I have also tried adding the file directly in app/design/adminhtml/Magento/Magento_Customer/web/template but it's not working either.
How can I overwrite html files from magento admin? I'm working in Magento 2.3.5 p-1.
Thanks in advance


texts: How to add Paypal Express Checkout button on a CMS page?

texts: I want to add a Paypal Express Checkout button on a CMS page to capture specific payment. Please help me. How can I accomplish that?


texts: Order is creating Automatically and after purchase also still product is in cart

texts:
For few days we are facing a different issue Once we place the Order successfully it is showing the older Order id (Order id 000000960 but our current Order id 1000+) Success page.
For reference please find the attached image.

it is happening only for few customers.

The second issue is.
After placing the order. New Order is creating automatically with different order numbers.
For reference please find the attached images.

The third issue is.
After placing the order the product is still in the cart only.


texts: How to upgrade Magento from 2.1.7 to 2.2.2 only from backend

texts:
I also tried to go to Component manger but it is spinning all the time.

And when I access to this url (got it from internet search)

  https://www.domain.com/setup/index.php/dependency-check/component-dependency

I am getting this error:

An error occurred during execution; please try again later.

===================================================
Additional information:

Zend\Json\Exception\RuntimeException

File:

public_html/vendor/zendframework/zend-json/src


texts: Magento Function Error : Website And Back-end Completely Stuck whenever run sales report

texts: If i try to run sales report my website and backend not working, every time i am going to reboot my server. Are any possible methods exits to avoid this issue?


texts: Hide an attribute when another attibute is enabled and vice versa Magento2.3.4-p2

texts:
I am using Magento Version 2.3.4-p2.
I need to hide sku attribute if another status attribute is enabled and vice versa in cart price rule form backend.
I need to change in xml file. Kindly check the below code and confirm.
app/code/Namespace/Promotions/view/adminhtml/ui_component/sales_rule_form.xml
 <fieldset name="rule_information" sortOrder="10">

            <field name="sku" formElement="input">
                <argument name="data" xsi:type="array">
                    <item name="config" xsi:type="array">
                        <item name="source" xsi:type="string">sku</item>
                    </item>
                </argument>
                <settings>
                    <dataType>text</dataType>
                    Literature SKU
                    <visible>true</visible>
                    <dataScope>sku</dataScope>
                </settings>
            </field>

            <field name="status" formElement="checkbox">
                <argument name="data" xsi:type="array">
                    <item name="config" xsi:type="array">
                        <item name="source" xsi:type="string">status</item>
                        <item name="default" xsi:type="number">0</item>
                    </item>
                </argument>
                <settings>
                    <dataType>boolean</dataType>
                    Status
                </settings>
                <formElements>
                    <checkbox>
                        <settings>
                            <valueMap>
                                <map name="false" xsi:type="number">0</map>
                                <map name="true" xsi:type="number">1</map>
                            </valueMap>
                            <prefer>toggle</prefer>
                        </settings>
                    </checkbox>
                </formElements>
            </field>
        </fieldset>

if anyone have any idea, please let me know.


texts: Set custom address attribute value programmatically

texts:
I'm using Magento v2.1.6 and I have created a custom attribute for customer address like this:

$customerEntity = $customerSetup->getEavConfig()->getEntityType('customer_address');
$attributeSetId = $customerEntity->getDefaultAttributeSetId();

$attributeSet = $this->attributeSetFactory->create();
$attributeGroupId = $attributeSet->getDefaultGroupId($attributeSetId);

$customerSetup->addAttribute('customer_address', 'subdistrict', [
                'type' => 'varchar',
                'label' => 'District',
                'input' => 'text',
                'required' => false,
                'visible' => true,
                'visible_on_front' => true,
                'user_defined' => false,
                'sort_order' => 83,
                'position' => 83,
                'system' => 0,
]);

$attribute = $customerSetup->getEavConfig()->getAttribute('customer_address', 'subdistrict')
                ->addData([
                    'attribute_set_id' => $attributeSetId,
                    'attribute_group_id' => $attributeGroupId,
                    'used_in_forms' => ['adminhtml_customer_address', 'customer_address_edit', 'customer_register_address','customer_address']
                ]);
$attribute->save();

I tried to save/update in one of the customer address like this:

public function __construct(
  \Magento\Customer\Api\AddressRepositoryInterface $addressRepository
)
{
   $this->addressRepository = $addressRepository;
}

public function execute(){
 $addressId = 1;
 $subdistrict = "Harbor City";
 $address = $this->addressRepository->getById($addressId);
 $address->setCustomAttribute('subdistrict',$subdistrict);
 $this->addressRepository->save($address);
}

But I am always getting an error saying :

  {"0":"Class object does not exist","1":"#0
  /var/www/Project/lib/internal/Magento/Framework/Reflection/MethodsMap.php(155):
  ReflectionClass->__construct('object')\n#1
  /var/www/Project/lib/internal/Magento/Framework/Reflection/MethodsMap.php(106)


texts: Send multiple invoice via single email Magento1.9

texts: Is there any way to send single invoice email that will have different order/invoice details like Invoice #0000085-89 via a single email.


texts: Difference between Magento 2 github download and magento official download site magento

texts:
What is the difference between Magento 2 github download and Magento official download site Magento download, what is better?

github 2.2.5 Magento file tar format file size: 25 MB ,
Magento official site 2.2.5 file tar file size: 47.68 MB


texts: setting up a multi-language contact form

texts:
I have a problem with a multi-language site, where I cannot make the contact form work for the 2nd language.

Here is my setup:

English contact form is at:
https://www.mysite.de/en/contacts

on submiting the forum it then loads:
https://www.mysite.de/en/contacts/index/

To customize the form, I made a dedicated page here:
the EN version is stored as a seperate tempalate here:
\app\design\frontend\ultimo\mytheme\template\contacts\form.phtml

the German version of the file is here:
\app\design\frontend\ultimo\mytheme\template\contacts\form-de.phtml

in this phtml, I have my form code, including the submit:

<?php echo Mage::helper('contacts')->__('* Required Fields') ?>

    <input type="text" name="hideit" id="hideit" value="" style="display:none !important;" />
    <button type="submit" title="<?php echo Mage::helper('contacts')->__('Submit') ?>" class="button"><?php echo Mage::helper('contacts')->__('Submit') ?></button>

for DE, is the same code as EN.

The EN form is using the default /contacts/ setup of magento > there's no special CMS page for this. However, for the DE version, I made a dedicated page, where I load this code:

{{block type="core/template" name="contactForm" form_action="/contacts/index/post" template="contacts/form-de.phtml"}}

This allows me to show the different form depending on the language.

However, here's the problem:

When I load the page from here: http://www.mysite.de/de/kontakt/ I see the form etc, everything looks good.

But on submit, it redirects to: http://www.mysite.de/contacts/index/post with a 404 page not found error.

I'm lost on how to sort this out, and appreciate any help!
Thanks.

edit:
- could it be something to do with the URL storecode options I am using in the system setup? If so, what could be the workaround do you think?


texts: How to set required field ''State/Province' of add new address in My Address Book, magento 2?

texts: Using magento 2.2, I want to set required on field State/Province in Add New Address in 'my address book'.


texts: How to set up a default font when adding a product

texts:
We use a specific font and size for all of our product descriptions etc when setting up a new product in Magento. Is there any way we can set our preferences as a default to save changing it every time?
Thank you in advance.


texts:
Why doesn't this:

<adminhtml_report_product_sold>
    <reference name="menu">
        <action method="setActive">
            <menupath>mymodulesmenupath</menupath>
        </action>
    </reference>
</adminhtml_report_product_sold>

make my module's menu active but instead the Reports menu remains active?  For context, I have a menu item which redirects to the products ordered report but I want my modules menu to be active as if the user is still in my menu.


texts: How to Move billing address to below shipping address form in onestep checkout (IWD_opc)?

texts:
How to Move billing address to below shipping address form in onestep checkout (IWD_opc) ?
We can move billing address section in shipping address area in Magento default checkout but not working same code for IWD_Opc


texts:
I am getting error

Warning: is_writable(): Unable to find the wrapper "unix" - did you forget to enable it when you configured PHP

While I am trying to turn on the compilation in Magento.

I can see this error message in system.log as well

Warning: is_writable(): Unable to find the wrapper "unix" - did you forget to enable it when you configured PHP?  in app/code/core/Mage/Core/Model/Session/Abstract/Varien.php on line 74.

What is this error?
How this can be fixed?

ADDED content of local.xml

<config>
  <global>
    <install>
      <date><![CDATA[Mon, 20 Apr 2015 05:56:22 +0000]]></date>
    </install>
    <crypt>
      <key><![CDATA[6cbdf8e6a8761e27f8a18dddd8578a8f]]></key>
    </crypt>
    <disable_local_modules>false</disable_local_modules>
    <resources>
      <db>
        <table_prefix><![CDATA[magento_]]></table_prefix>
      </db>
      <default_setup>
        <connection>
          <host><![CDATA[localhost]]></host>
          <username><![CDATA[database_user]]></username>
          <password><![CDATA[password]]></password>
          <dbname><![CDATA[db_name]]></dbname>
          <initStatements><![CDATA[SET NAMES utf8]]></initStatements>
          <model><![CDATA[mysql4]]></model>
          <type><![CDATA[pdo_mysql]]></type>
          <pdoType><![CDATA[]]></pdoType>
          <active>1</active>
        </connection>
      </default_setup>
    </resources>
    <session_save><![CDATA[files]]></session_save>
  </global>
  <admin>
    <routers>
      <adminhtml>
        <args>
          <frontName><![CDATA[admin]]></frontName>
        </args>
      </adminhtml>
    </routers>
  </admin>
</config>


texts: Magento2: crontab not working in magento for emarsys catalog generation?

texts:
I am trying to run the command php bin/module cron:run but getting error in CLI.
Here is my crontab.xml

<?xml version="1.0"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
        <group id="default">
            <job name="emarsys_catalog_bulk_export" instance="Emarsys\Emarsys\Cron\ProductBulkExport" method="execute">
            <schedule>0 0 30 2 3</schedule>
            </job>
        </group>
     </config>

ERROR :

[Magento\Framework\Exception\LocalizedException]
  Invalid Document
  Element 'job': The attribute 'instance' is required but missing.
  Line: 4

 Element 'job': The attribute 'method' is required but missing.
  Line: 4

 Element 'schedule': Element content is not allowed, because the type definition is simple.
  Line: 5

 Element 'schedule': [facet 'minLength'] The value has a length of '0'; this underruns the allowed minimum length of '5'.
  Line: 5

  Element 'schedule': '' is not a valid value of the list type 'scheduleDeclaration'.
  Line: 5

 Element 'run': This element is not expected. Expected is ( config_path ).
  Line: 8

cron:run [--group GROUP] [--bootstrap BOOTSTRAP]


texts: I have an observer and i need to generate a css file dynamically - using my admin theme setting configuration - calling my observer function.


texts: Raw query to display promotion name and how many orders it has been used with?

texts:
Title says it. I am looking for a raw query (direct sql) to tell me a promotions name, and how many orders it has been used on. Results should look something like this

+----------------------------+-------------+
| Promotion Name             | # of Orders |
+----------------------------+-------------+
| Full Price                 |           2 |
| Looting Sale               |           3 |
+----------------------------+-------------+

I am having a hard time even finding where the promotion name is kept, much less the times of orders


texts:
I want new date from current date, difference of 30 days.

$dt = date("Y/m/j",strtotime("-1 month"));
and
$firstDayOfPrevMonth = date("01.m.Y", Mage::getModel('core/date')->timestamp(strtotime('first day of previos month')));

above is not working for me.


texts: how to keep the checkbox as selected after submitting the form in magento

texts:
I have created a form and submitted to a controller action, the checkbox values are posted to controller, there is fine working.

But after submitting the form i cannot see the tick in  checkbox which is selected .

Below is the code

    <form id="notification" name="notification" method="post" action="<?php echo $this->getUploadUrl()?>" enctype="multipart/form-data">
        <input name="form_key" type="hidden" value="<?php echo $this->getFormKey()?>" />
        <fieldset id="my-fieldset">

Notification Setting

                    <input type="checkbox" name="new-lot" <?php if(isset($_POST['new-lot'])) echo "checked='checked'"; ?> >&nbsp;Notify Me When new lot is imported</input>

                    <input type="checkbox" name="remark-added" <?php if(isset($_POST['remark-added'])) echo "checked='checked'"; ?>&nbsp;Notify Me When any new remark added </input>

                        <button type="submit" class="scalable save" title="Notificatiom">

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

                        </button>

        </fieldset>
    </form>


texts: magento 2 one step checkout not capturing abandoned email

texts:
I am using BSS one step checkout extension and Mageplaza Abandoned cart email extension.

Here I see the after filling checkout form the Guest user information not saving under quote table in db. So what should I do to save guest customer information in quote table when guest customer put email.

here is video showing about user and Guest user: http://somup.com/cqXFjvfbW6


texts: How to add a JS script after full loading checkout page?

texts: Since the DOM on the checkout page is loaded in an asynchronous way - I do not have access to some elements. Please suggest me how we can add a custom script to the checkout page after loading all the elements.


texts: Magento doesn't display product images more than 1 MB

texts:
Product image is uploaded succesfully in admin backend, but it doesn't display on frontend product page (404 error).

The image backend url:
/media/catalog/product/5/0/50_2_1_4.jpg

Frontend url: /media/catalog/product/cache/1/image/9df78eab33525d08d6e5fb8d27136e95/5/0/50_2_1_4.jpg and it doesn't exist on ftp.

If file size less than 1 MB, frontend image uploads ok.

I checked chmod permissions for media and all subfolders - 777.

My server has curl; image gd - enabled; file_uploads - on; upload_max_filesize - 12M; post_max_size - 20M; max_file_uploads - 20; upload_tmp_dir - no value;

I enabled/disabled/updated/flushed magento cache but nothing solved the issue.

Is it possible to remove this limit and how can I do it?

Hope for your help and thanks everyone.


texts: Get Category name on any category page in Magento 2

texts:
How can I get current category name when I am on a category page?

I tried some solutions, but they don't work when category is chosen from layered navigation. For example, if I click on category filter on left side - layered navigation, it returns URL: examplepage.com/sport/fitness.html?cat=40
and current category is Fitness, instead of Stepers.

When I go to category Stepers from main menu, the URL is:
examplepage.com/sport/fitness/stepers.html and current category is Stepers, which is correct.

I hope it is understandable:)


texts: Magento 2: I am curious on how plugin works behind the scene

texts: Magento 2 has something called Plugin. What I understand, Plugin is part of the Magento 2 module's function which allows you to listen to a called method in a class. Can someone tell me how Magento does this under the hood?


texts: Magento Ajax toolbar/pagination not loading correctly for root product category

texts:
I'm currently learning Magento and have a strange issue with the toolbar/pagination Ajax script.

Custom theme used - BuyShop

I'd usually leave code examples, however, I can't work out which code to target.

Parent category page: domain.com/products.html

Subcategory page: domain.com/products/juico-juicers.html

When on a subcategory page the ajax toolbar/pagination script works perfectly. For example if you click page 2, /products/juico-juicers.html?p=2, it loads perfectly.

When you do the same on the parent category page, /products.html?p=2, it loads incorrectly; I think it's a parsing issue.

Any help on this issue would be great!!!


texts: Magento 2: Invalid backend response. Data is not JSON in dashboard

texts:
When i try to upload a image from dashboard i get the following error:

¿What is the problem? :(
Thanksss


texts: Cms page (or static block) inside product description

texts:
I need to add some static content inside the product description.

I have a store where I bulk add all my products via CSV import and many of them share common HTML code in the description field, for example, the model description.

Let's say that I have 500 products model XYZ and the XYZ description is

XYZ

The next generation of XY

is there a way to create this as a cms page (or static block) and insert it in the description of the products?

I could have it done editing the layout of the product page, but I want it in the description so I can easily sync it with eBay and other markets.

Thank you


texts: Magento 2: How to make Product image uploader rename the image file if the same filename exists?

texts: I'm using Magento v2.3.4 and Cloudflare to cache CSS, js, and images. The problem is when i tried to upload the product image from the backend using the same filename and extension, the image uploader still showing the old image, if i turn off the Cloudflare caching, this issue doesn't exist because the file is not being cached. Is there a way to rename the image where the image is being uploaded using the same filename or extension using the product image uploader ?


texts:
I have used reset password and changed the password.

When try to login with the new password i changed from the forgot password link.

Getting below error.

You did not sign in correctly or your account is temporarily disabled.

I have entered correct password.

Before reset password also same error i was getting. Has anyone faced the same issue?

Any help would be appreciated.


texts:
I have magento multi (multiwebsite) store like www.example.com and customer login is working fine here.

My other store Url is shop.example.com and when customer try to login after registration on shop.example.com not able to login.


texts:
I'm having some problems within the product description as my client wants to use the wysiwyg-editor and its image upload features.
Sadly all inserted image variables won't get parsed correctly so the output is something like this:

<img src="{{media url="someurl"}}">

which is in fact the same as the raw input.

Any suggestions how to fix this? I obviously don't want to change all image links to something hardcoded even if my client has just around 100 products ;)

(Magento 1.7.0.2)


texts: Get all the products from the buy request object in observer

texts:
I have the following :

   $buyRequest = $observer->getEvent()->getBuyRequest();
   $products = $buyRequest->getAllItems();
      foreach ($products as $product) {
         $productqtty = $product->getQty();

What could be wrong?


texts: magneto 2 How can i call Owl Carousel Slider in html file?

texts:
I need to owl carousel slider in html file magneto 2.

app/code/Alps/Deliveryshipping/view/frontend/web/template/shipping-address/shipping-method-list.html

Owl slider code

1

2

3

I have placed Owl slider js in

app/design/frontend/pakage_name/theme_name/default/web/js

I have called owl slider js in require.js

/**
 *  This is used for slider
 */
var config = {
    paths: {
            'owlcarousel': "js/owl.carousel.min",
        },
    shim: {
        'owlcarousel': {
            deps: ['jquery']
        }
    }
};

but it's not working.

Any help would be appreciated.


texts: Is there any free Magento 2 payment gateway extension

texts: Is there any free Magento 2 payment extension, which supports American Express Card payment? And in the back-end option, there is a sandbox setting.


texts: magento mysql server has gone away SELECT `main_table`.* FROM `core_config_data

texts:
site is very very slow and we got this error in  backend:

General error: 2006 MySQL server has gone away, query was: SELECT `main_table`.* FROM `core_config_data` AS `main_table` WHERE (`value` LIKE '{{base_url}}')


texts: How to add shipped date to admin sales order grid

texts:
I am stuck with adding new column(Shipped date) to sales order admin grid. I copied the file Grid.php from app/code/core/Mage/Adminhtml/Block/Sales/Order to app/code/local/Mage/Adminhtml/Block/Sales/Order and in the _prepareCollection() function added the code

$collection->getSelect()->joinLeft('sales_flat_shipment_grid','sales_flat_shipment_grid.order_id=main_table.entity_id',array('shipped_date' => 'sales_flat_shipment_grid.created_at'));

and in _prepareColumns() added this

$this->addColumn('shipped_date', array(
      'header'    => Mage::helper('sales')->__('Shipped Date'),
      'index'     => 'shipped_date',
      'type'      => 'datetime',
      'filter_index'=>'sales_flat_shipment_grid.created_at',
));

My problem is when there are orders with multiple shipments and when I go to the sales order grid  I get the error There has been an error processing your request which says there is a duplicate order id.
If there are no multiple shipments for orders, then the sales order grid is fine and shows the shipped date for the corresponding orders.

Could someone help me with this?


texts: Undefined index: HTTP_USER_AGENT in /app/code/core/Mage/Core/Model/Design/Package.php on line 611

texts:
I am using magento enterprise edition (Magento ver. 1.14.0.1) got this error of Undefined index: HTTP_USER_AGENT when use web service call from mobile app. After some research i got that in package.php file need to check HTTP_USER_AGENT where it's having if condition

  if (!empty(self::$_regexMatchCache[$rule['regexp']][$_SERVER['HTTP_USER_AGENT']]))

also found that in System > Configuration >Design we can add exception to change theme for mobile which in my case is blank, is this case i am getting this error or some thing else?


texts: Magento 2 display all sub-categories above the product list on the category page

texts: How can I display all sub-categories above the product list on the category page?


texts: Magento 2 checkout: how to make vat number required

texts: How can I make the vat tax required in the Magento-2 checkout? From the panel, I can set it as default only in the "create new account" form.


texts: Unable to get custom customer data in a standard manner?

texts:
I have added few custom attributes and one of them is is_mobile_verified while registering I dont set any value for this however, while creating the attribute I set default value as 0.

now after registration, I am trying to get the value to do some other functionalities. I am facing issues at this point.

        $customer_id = 39; // SETTING SOME ID FOR TESTING PURPOSE
        $is_verified = $customer->getCustomAttribute('is_mobile_verified')->getValue();

If I get the value using this code I am getting error message as below

  Fatal error: Uncaught Error: Call to a member function getValue() on null in C:\xampp\htdocs\

Because there is no value updated to this fields so for. Once from the admin section if I updated as 0 Then it returns the value.

Is there a way to restrict this behavior as in the earlier scenario also, if there is no value exist I can get empty value. Apparently this is what the actual behavior in Magento1.x


texts: Magento 1.9.2 Responsivebannerslider sider not working

texts:
I tried for an hours, after update the magento version 1.9.1 to 1.9.2 the Responsivebannerslider is not working.In controller terminate the process,but it's also not working.Also i tried in block index to terminate the process

function getResponsivebannersliderEnabled(){
  echo "Test";die;
  return Mage::getStoreConfig('generalsetting/mksresponsivegroup/enable',Mage::app()->getStore());
}

Please suggest me how to resolve this problem.


texts:
How do I move the review tab on the product page?

The code to generate the tabs is found in app/design/frontend/example/shop/template/catalog/product/view.phtml

        <?php if ($detailedInfoGroup = $this->getChildGroup('detailed_info', 'getChildHtml')):?>

                <?php foreach ($detailedInfoGroup as $alias => $html):?>

<?php echo $this->escapeHtml($this->getChildData($alias, 'title')) ?>

<?php echo $html ?>

                <?php endforeach;?>

        <?php endif; ?>

It currently looks like so:

this is what I'd like to achieve:


texts:
For test and development, I duplicated our Magento shop to a sub-domain.

  mysql -u root -p -e "USE bitnami_magento; UPDATE core_config_data SET
  value ='http://subdomain.site.com/' WHERE core_config_data.path =
  'web/unsecure/base_url'; UPDATE core_config_data SET value
  ='https://subdomain.site.com/' WHERE core_config_data.path = 'web/secure/base_url';

Everything works, but not the admin Login. On the login page we get it. After entering my user name and password we don't log in. Login error message ("invalid password", etc.) ISN`T being displayed.

We are using 1.9.0.1

Removing cache files ...

sudo rm -r /opt/bitnami/apps/magento/htdocs/var/cache/*
sudo rm -r /opt/bitnami/apps/magento/htdocs/var/session/*

.. and restarting Apache ..

sudo /opt/bitnami/ctlscript.sh restart apache

.. Does not help.

Please any advice - what could be the reason?


texts: Categories - how to display in alphabetical order? (Programmatically)

texts:
We've been importing a lot of data into Magento CE using Magmi. It's creating our category tree for us.

However, we'd like to display our category tree in alphabetical order. Is there a way to sort the entire tree (20 top level categories, 100's of sub-categories in the tree) into alphabetical order?

Edit: for clarity, the sorting needs to be done programmatically in some way


texts:
I stumbled with this problem earlier. I've attached a screenshot below for your reference. If you have any ideas just let me know.

If I will run php bin/magento setup:upgrade it will show an error

Thanks!


texts: Display most important attribute in list view

texts:
In the list view, I want to display the 3 most important attributes of the product below the productname.

What is the best way to fix this?
Is there a way to highlight some attribute, so that these can be displayed there?


texts: Image on category page without product information

texts:
At the moment magento is using the images i uploaded and includes the other information (description, price, 'as low as' price and 'add to cart' option). Instead of this, I want to create an image for each product, as I have for the first product below, but have my own text information included in the image. Therefor I only want an image displayed, no other information. I still need it to link through to that product.

How could I achieve this? Many thanks


texts: Magento 2.2 : Upgrade customer_eav_attribute table 2.1 to 2.2

texts:
After updating Magento 2.1 to Magento 2.2 I get the following error when saving a client.

I have seen that in the customer_eav_attribute table the data has not been updated correctly to the new version.

For exemple, I have:

  a:2:{s:15:"max_text_length";i:255;s:15:"min_text_length";i:1;}

And in version 2.2 it is necessary to have:

  {"max_text_length":255,"min_text_length":1}

How to update this table? without reinstall Magento 2.2


texts: Hide in "Browse By" side block product numbers if there are no products in that category

texts:
I am using a tree of categories, the last category in the tree has products. All the others have only links to subcategories or texts (static blocks). Here is an example:

Category A --> Category A1 ----> Category A11 ---> Category A111

Category A page has image links to category A1 and texts. Categories A11 has image links to A111. Only A111 has products associated.

"Browse By" side block shows 0 products for a category without products inside (A1 and A11). I would like to keep showing products numbers for categories but only for those which have products inside.

I guess it is an if statement inside a file, but I need advice. This can be solved in an elegant way by using a check box or select dropdown Yes/Now when creating a category. If that category doesn't have products inside, just static blocks, you can select "Not show product count numbers" (in case it is enabled). Based on this option in Browse By you won't get zero products for this category.

As it is now Magento has a seriously logical issues. This is bad because a visitor won't go inside when seeing zero products.


texts: How to share product image and details in social media in Magento 2?

texts:
I want to share product image and details to social media in Magento 2 using addthistool.

We have added http://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5b30cd59923bb69c js in header part

Phtml

  Custom/Module/view/frontend/templates/product/view/social-share.phtml

Block

  Custom/Module/view/layout/frontend/catalog_product_view.xml

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

    <referenceContainer name="content">
        <block class="Magento\Catalog\Block\Product\View" name="product.view.addthis.custom.social-share" template="Custom_Module::product/view/social-share.phtml" before="-" />
    </referenceContainer>


texts: Google Tag Manager enhanced ecommerce - Datalayers

texts:
I have setup enhanced ecommerce for my client. (batteribyen.dk). They use Magento Enterprise

I followed this guide:

https://docs.magento.com/m1/ee/user_guide/marketing/google-universal-analytics-enhanced-ecommerce.html

My problem is:

I don't get productinformation in Google Analytics.
I miss the steps (Add To Cart and Continued checkout in Analytics)

My datalayer in Google Tag Manager only works in productview and on purchase. Alle the other steps it dosen't create a datalayer and my AddToCart event isn't called at all.

Have anyone tried anything like this?


texts: Add all flat-attributes to product collection?

texts: How can I get a catalog/product collection with all attributes which are selected to be "used in product listing", i.e. are in the flat table?


texts: Magento 2: Checkout afterplace order plugin not working

texts:
Im creating a Magento 2 checkout plugin, I want to fetch the orderdata and send it to a third party for order handling.

I have made a plugin for the Magento\Sales\Api\OrderManagementInterface class, where I want to write a new function for the place method.

this is my code:

etc/di.xml

<?xml version="1.0" ?>
<config>
    <type name="Magento\Sales\Api\OrderManagementInterface">
        <plugin name="CbFashionAfterPlacePlugin" type="\Digitaq\CbFashion\Plugin\Order\PlaceAfterPlugin" />
    </type>
</config>

Digitaq\CbFashion\Plugin\Order\PlaceAfterPlugin

<?php

namespace Digitaq\CbFashion\Plugin\Order;

class PlaceAfterPlugin {

    public function afterPlace()
    {
    }
}

Even though I have not added any new functionalities, the checkout redirects to the cart with the items still in it, and I can't see an error getting logged anywhere.

Can anybody tell me what the right way is to get the order data after an order is placed, both from admin as frontend? What is going wrong in this situation?

I have also tried to do it with an Observer using the sales_order_place_after event, but this gave the same result. Any help would be highly appreciated!


texts:
Hello I am trying to upload product attribute value for french store. but some of csv row not able to execute and giving Error "Skipping import row, required field "sku" is not defined.".

For getting solution of this problem i export particular one product and just change data below header row.

Even if they are giving me same error and any body have any idea ? i am using open office.

both csv placed here origanal csv and

modified csv

Thanks in advance


texts: setup:di:compile error | source class generation does not exist

texts:
bin/magento setup:di:compile give me this error
Magento version 2.2.5

Source class "\Vendor\Module\Model\PostProductsInterface" for "\Vendor\Module\Model\PostProductsRepository" generation does not exist.


texts: Magento 2 update product attribute options programatically

texts:
I have a website with multiple stores (One for each country, around 170 countries in total) and each store has two store views. One for the English language and one for the Greek.

Is it possible to set the same value for all stores with the English language?

I'm using the code below to load the current attributes:

// list of attributes
$attributes = [141,142,143];

// get stores using the english language
foreach ($storesList as $storeKey => $storeValues) {

    // get store code information
    $targetLanguageParts = explode("_", $storeValues["code"]);

    // get target language
    $targetLanguage = $targetLanguageParts[1];

    // if store is in english
    if (strpos($targetLanguage, "en")!==false) {

        // add to list of english stores
        $englishStores[] = $storeKey;

        // get values for each attribute
        foreach ($attributes as $attribute) {
            // load attribute
            $attributeData = $eavConfig->getAttribute('catalog_product', $attribute);

            // all attribute options
            $alloptions = $attributeData->getSource()->getAllOptions();

            // for each option
            foreach ($alloptions as $option) {
                // get label
                $label = $option['label'];

                // get value
                $value = $option['value'];

            }
        }
    }
}

Thanks in advance!


texts: Magento2: how to display small images of product collection data?

texts:
how to display small images of product collection data?

Magento 2.0