texts: How to remove trailing slash adding in pagination urls

texts:
I have added code in my htaccess to add trailing slash in my Magento 2.3.2 website URLs.

I want to exclude the pagination pages including questions to add a trailing slash.

For example - I have URL https://example.com/blog?p=2 which is redirecting to https://example.com/blog/?p=2.

I want to exclude these pages with "blog?p" to add a trailing slash.

Please provide a solution.

Thanks!!!


texts: Magento 2.2 REST API Call to get media, does not return base 64 string

texts:
I tried the call

  /V1/products/:sku/media/

I get this response

[{
        "id": 31,
        "media_type": "image",
        "label": null,
        "position": 1,
        "disabled": false,
        "types": [
            "image",
            "small_image",
            "thumbnail",
            "swatch_image"
        ],
        "file": "/9/1/91sh_fuln0l._ux342__1.jpg"
    }]

Expected response as per dev docs contains the object

 "content": {
      "base64_encoded_data": "string",
      "type": "string",
      "name": "string"
    },

Does anyone know why it is missing?


texts: Why would my core_config_data table be empty?

texts:
I have a live functional Magento implementation and have today tried out a new staging environment using Vagrant and Puppet. For reference here is the repo I used.
https://github.com/matthewsplant/magento-vagrant-puppet

My problem is once I’ve imported my SQL dump from the live environment and go to make the base url changes for a localhost I find a completely empty table.

Why might this be? On checking back on my live environment, I find the same (of course)
There is a core_config_data table but it has no content.

I’d really appreciate a pointer


texts: How to translate "Products Comparison List - Magento commerce"

texts:
I managed to translate "Products Comparison List" but the following line "- Magento commerce" I'm not able to translate. Can't figure it out. I tried with the Mage_Catalog.csv file and catalog.xml but could find the translation for  "- Magento commerce".

Any ideas?


texts:
I have this weird situation where SOAP retuns no value but I am not sure how to check whether it has returned any value or not.

For example, I am calling SOAP to get product image detail like this:

$result = $this->proxy->call($this->sopaSession, 'catalog_product_attribute_media.list', $sku);

For one SKU, I have images uploaded and it returns the correct values into $result. All fine, all happy!

But for another SKU, I do not have any images uploaded. So, upon calling aforementioned statement for this SKU, I am not sure what is returned - null? false? empty string?

if ($result){

    return $result;
}

or

       if (isset(result)){

            return $result;
        }

or

       if ($result === null){

            return $result;
        }

None of these really work.

I am relatively new to PHP, Magento and SOAP.

Please guide me how can I check whether my SOAP call has returned any value or not. Based if a product has image or not, I want to do some further processing.

Appreciate any kind of hint/help.

Thank you!
Dhananjay


texts: Configurable child products without image

texts:
I have one problem. I am using since a time a new theme, the problem is that when I select a size in a configurable image, don´t shows any image, shows the placeholder image of Magento.
The theme creator told me:
The theme works the same as the RWD theme and it shows placeholder image since the image is not uploaded to the child product.

Is there any possibility to show the image of the parent product?
You can see the example here, when you select a size no image it´s shown:
https://www.espamoto.com/casco-shark-street-drak-neon-mat-anthracite-black.html


texts: REST: How to get attribute text instead of id

texts:
Getting product and order data through the appropriate api calls work well, but a problem arises when a product attribute uses dropdown or similar lists, where the value I get through the api is the ID of the selected value, not the label/value.

At least by default, Magento offers no resource called 'Attribute' that could deliver those values.

Is there a way to retrieve either the corresponding value to a given ID or the matrix (ID : value) of such an attribute?

I would need this kind of data from multiple shops, ranging from ce-1.8.0.1 to ce-1.9.0.1


texts: How to calculate an invoice with canceled items?

texts:
I have a order with canceled order items in it.
As an example:
Item 1 = 10 euro
Item 2 = 20 euro
Item 3 = 30 euro

Now the items 2 and 3 are canceled.
The grand_total should now be 10 Euro.

But when I create an invoice programmatically the invoice is always 60 euro.

To create my invoice I create a new Mage_Sales_Model_Order $order and use this for my invoice. But inside that model there are also the canceled items and so my invoice is always wrong.


texts:
In checkout It shows a summary with all costs, it also shows the tax costs (Steuer [german]).

How can I get the tax costs from PHP?


texts: sales that affect other product inventory? How can I accomplish this? Help please!

texts:
I apologize if this has been asked already. I also posted this in the magento forums, and am trying to figure out how this can work. I am using the latest version. Here’s my scenario. I have configurable products available in three different package quantities.

50-pack
5-pack
single

Here’s the behavior I am after.

Let’s assume that I have 2x 50 packs in stock. I want the inventory to look like this:

50-pack: 2

5-pack: 20

single: 100

Assuming that a single is sold, inventory would look like this:

50-pack: 1

5-pack: 19

single: 99

Assuming that a 5-pack is sold, it would look like this:

50-pack: 1

5-pack: 19

single: 95

and if a 50-pack was sold, it would be:

50-pack: 1

5-pack: 10

single: 50

lastly, if a quantity of 12 was sold it would look like:

50-pack: 1

5-pack: 17

single: 88

Please let me know how I can clarify.

What’s the best approach to achieve this? whether built-in or through an extension, doesn’t matter. I apologize if this has been covered already. I’m not exactly sure on what to search for. I’ve looked at grouped products, and I’m not sure that will meet my needs.


texts: Newsletter block at footer weird problem

texts:
Magento 1.9.2.2, I'm trying to put a newsletter subscribe form at footer.

By using {{block type="newsletter/subscribe" template="newsletter/subscribe.phtml"}} the block is not showing up,

By using {{block type="core/template" template="newsletter/subscribe.phtml"}} the block is showing, but not working.

Any ideas what the issue is and how to fix?

Any help is much appreciated.


texts: Redirecting customers to different pages based on customer group

texts: I have been asked how much work this would be to do, I assume I would need to edit the AccountController.php But before I even start I am wondering if anyone knows first if possible and second how much work would it actually be to be able to control my 5 customer groups and give them each specific redirects?


texts: How can i include a block in wishlist page

texts:
I want to add a block in wishlist layout.

<block class="Magento\ConfigurableProduct\Block\Product\View\Type\Configurable" name="product.info.options.configurable" as="options_configurable" before="-" template="Magento_ConfigurableProduct::product/view/type/options/configurable.phtml"/>

I added it in wishlist_index_index.xml file but it's not displaying.

I want it below the price.
I want it to appear like this.


texts: Magento create new user role white/blank page

texts:
When I want to add a new user role I get a white/blank page. Every other page in the admin seems to work fine except this page.

Does somebody have a sollution or a way to check what is wrong?


texts: Categories in the Admin panel do not load-ERR (3):Warning:simplexml_load_string():Entity:line9:parser error:Premature end of data in tag config line2

texts:
When going into CATALOG --) Manage categories --) and trying to load the details of a specific category - it comes up blank after it tries to pull the information (you can see it's doing that when the "Please wait" sign with the progress wheel comes on but something seems to get in the way and nothing comes up.

The exact Error in the Magento root->Var->log-> System.log file is:

  "2016-08-13T23:51:01+00:00 ERR (3): Warning: simplexml_load_string():
  Entity: line 9: parser error : Premature end of data in tag config
  line 2 in /home/flower/public_html/lib/Varien/Simplexml/Config.php on
  line 510"

Categories is the ONLY thing not working in the Admin.

I've done this so far:

disabled ModSec completely (we had a problem with this before in the same situation)
according to the hosting company - PDO and mysql extensions are currently set up properly
SOAP extensions are enabled on server
ran the following command:

curl -l 'http://www.example.com/index.php/api/v2_soap/index/wsdl/1/' > /tmp/wsdl.xml

but then no output was provided as you can see below:

root@new [/]# curl -l 'http://example.com/index.php/api/v2_soap/index/wsdl/1/' > /tmp/wsdl.xml
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0

root@new [/]# cat /tmp/wsdl.xml
root@new [/]#

The Timeout is set to 300, I've increased KeepAlive timeout as well from 5 to 30 but the issue still persists.
The related databases are OK

Magento version 1.9.1


texts: How to add WYSIWYG Editor to Dynamic fields in System Configuration in Magento 2

texts: I want to add WYSIWYG Editor in Dynamic fields in System Configuration .


texts:
I am currently developing a website, but have a problem with the checkout page. When you have filled out the billing information, and select the Ship to the Address option and press continue, it doesn't do anything.and when I'm selecting shipping to another address also not works, please help me out.

Thanks in Advance.


texts: Product Attribute swatch image in template

texts:
I have a product Attribute that can be set as a swatch with an image.

How can I get the swatch image src in my template ?

I can use the following to get the label.

$attribute_value = $_product->getData( $attributeCode );
 $optionText = $attr->getSource()->getOptionText( $attribute_value );

Thanks.


texts: How to add svg icons to Swatch attribute (disable admin panel file validation)?

texts: Currently, I can load png/jpg files in swatch attribute, but when I tried to load save attribute with loaded svg file, it's not working. When I load svg from servers - it displays well, but when I tried to add svg file through the admin panel - it's not work.


texts:
Since Magento 2.2.6 was released not long ago we wanted to update our installation via CLI. Unfortunatly i stepped accross a few problems.

Steps I've done so far

composer require magento/product-community-edition 2.2.6 --no-update

composer update

And thats where the problems kick in, after loading the repos for a while i get the following error:

Your requirements could not be resolved to an installable set of packages.
Problem 1
- doctrine/annotations v1.6.0 requires php ^7.1 -> your PHP version (7.0.32) does not satisfy that requirement.
- doctrine/annotations v1.6.0 requires php ^7.1 -> your PHP version (7.0.32) does not satisfy that requirement.
- doctrine/annotations v1.6.0 requires php ^7.1 -> your PHP version (7.0.32) does not satisfy that requirement.
- Installation request for doctrine/annotations 1.6.0 -> satisfiable by doctrine/annotations[v1.6.0].

I thought it will be an easy fix by just using the php71 prefix but it seems like Magento dont want that since i get this line then

- magento/product-community-edition 2.1.6 requires php ~5.6.5|7.0.2|7.0.4|~7.0.6 -> your PHP version (7.1.22) does not satisfy that requirement.

How do i update if the php requirements are that different ?


texts:
I'm trying to add a custom note to Magento's invoice PDF documents. I'm using the Deliverynote plugin.

I am trying to add this piece of code to the invoice.php code but I'm not getting any results.

$noteId = Mage::registry('current_invoice')->getOrder()->getData('delivery_note_id');

$this->_note = Mage::getModel('deliverynote/note')->load($noteId)->getNote();

Here is the Github location https://github.com/drewhunter/ShipNote

I also tried doing this.

        $newnote = new Dh_Deliverynote_Block_Adminhtml_Sales_Order_Note();

        $newnote->_initNote();
        $var = $newnote->$_note;

        $vars = serialize($var);

        $this->insertDocumentNumber(
            $page,
            Mage::helper('sales')->__('Invoice # ') . $vars . $invoice->getIncrementId()
        );

How would I insert that into the PDF?


texts: Magento 2: How to get only the file name of Home Page Logo?

texts: is there a way to only get the filename of an Homepage logo in the logo.phtml template file? $block->getLogoSrc() in logo.phtml returns the URL to the logo, but I need only the filename like someimage.jpeg.


texts: Change sequence of dynamic sku for bundle product in cart

texts:
How can I change the order of the associated option's SKUs when they are added to the bundle product SKU in the cart page?

So, for example, a bundle product (SKU "Bundle1") is added to the cart with two associated products (SKUs "Simple1" and "Simple2"). The option Simple1 is listed before Simple2 on the bundle page, but in the cart, the dynamic SKU is "Bundle1-Simple2-Simple1". How can I make it "Bundle1-Simple1-Simple2" -- to match the order in which the simple products are displayed on the bundle page?

I'm using Magento CE 1.7.


texts: after magento upgrade 1.7.0.2 to 1.9.3.9 add to cart after blank screen open

texts:
URL like generate https://domain.com/stage/checkout/cart/add/uenc/
how to solve it this issue
Thank you in advance!


texts: Order details page is disturbed on admin side Magento

texts:
When i goto my order details page its look disturbed ,i think some css or something missing that disturb the layout.I replace the sales folder and upload new css but still no luck.What else i try to set that ? I tried to disable extensions but no luck again.My page look like this :

I got this error on enabling the logs.

2015-02-09T05:24:31+00:00 ERR (3): Warning: simplexml_load_string(): ^  in /home/firstchoicedds/public_html/lib/Varien/Simplexml/Config.php on line 510


texts: How to change category page layout 4 columns to 3 columns - Magento 2

texts: How to change the Category page's layout from 4 columns to 3 columns?


texts: How to Make Indexing process Async. in Magento 2

texts:
I am using Indexing process in Magento 2.
I have 60 Million products and when i run indexer it just struck in processing from past 4 days.
When i check indexer status on sow processlist it will run only one query.
Is it any way to make the indexer Asynchronous means multiple queries will be runnin at one time so multiple product will be re-indexed.
Any help is appreciated.


texts: jQuery UI breaks when clicking on draggable element: "Cannot read property 'defaultView' of undefined"

texts:
I'm using Ultimo theme and created a child theme. I created a custom module that uses jQuery UI draggable. When the page loads it's all fine but when I click on an element that should be able to be dragged, the console gives an error:

  Uncaught TypeError: Cannot read property 'defaultView' of undefined ..... jquery.js:6702

Seems like it is conflicting with jQuery but I have no clue how to fix it, even after reading numerous posts about problems similar to this.

How can I fix this error?

requirejs-config.js @ app/code/Vendor/Module/view/frontend

var config = {
    map: {
        jqueryui: 'Vendor_Module/js/jquery-ui.min'
    }
};

drag.js file @ app/code/Vendor/Module/view/frontend/web/js

require(['jquery', 'jquery/ui'], function($){
    $(document).ready(function() {

        // Makes the pieces draggable & sets options
        $("#piecesArea > div > img").draggable({
            //Makes it so that the pieces' z-index can be reordered
            stack: { group: '#piecesArea > div > img', min: 500,scroll: false },
            distance: 0
        });

        // Sets what happens when you release a piece
        $("#roomArea").droppable({
            drop: function(event, ui){
                // This is so that the element "sticks" even when tab is changed.
                ui.draggable.addClass("draggedout");
            },
            // Changes current tab to the tab the piece belongs to when dragged out of body area
            out: function(event, ui){
                ui.draggable.removeClass("draggedout");
                var whichTab = ui.draggable.parent().attr("id");
                $("#piecesArea").tabs('select' , whichTab);
            }
        });

        // Tabs
        $("#piecesArea").tabs();

        // Changes the body when thumbnails are clicked
        $("#swatchesArea a").click( function() {
            var changeSrc = $(this).attr("href");
            $("#roomArea>img").attr("src", changeSrc);
            return false;
        });
    });
});

default.xml @ app/code/Vendor/Module/view/frontend/layout

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
  <head>
    <link src="Vendor_Module::js/drag.js"/>
    <css src="Vendor_Module::css/mainstylesheet.css"/>
  </head>
  <body/>
</page>


texts: Magento 2 - catalog product list widget product order

texts: The homepage of my magento website is showing a product list. This product list was made with the catalog product list widget configured to show the products which are in the homepage category. Products in this category have a position number. Products are displayed in what seems to be price ordered list. How do I get the widget to display position ordered list ?


texts: How to Access Shipment from Order ID and product ID?

texts:
In my activity, I can have several shipments per order. Shipments are generated automattically by a module I coded.

I now would like to access the shipment linked to a selected order (ID) and containing a selected product (ID).

I thought using the "AddAttributeToFilter" function, but I do not know how to use them exactly in this context.

Thank you for your help,


texts: Error while importing csv file in magento 2

texts:
When I enter AE-SH in the state/region column of csv file it shows the error
"We couldn't import this file because of these errors: Please correct Region/State "SH" in the Row #19."


texts: Is there any addon that will take an order from pending to prepaired to ship when an item that has been ordered comes into stock?


texts:
I tried to upload images for product but its not uploading and getting an like

  unable to list current working directory


texts: Magento 2: get shipment collection by order

texts:
I try to add custom action for generate PDF file for merchant (marketplace), like in the backend (Shipment > Action > PDF Shipments).

Try to call function in the backend but it request shipments collection (location: Magento\Module-sales\Model\Order\Pdf\Shipment.php)

Right now I have order collection but don't know how to get shipment collection?


texts: Programmatically added product has empty Quantity field and doesn't show up on the frontend

texts:
I am trying to add a product to my Magento store programmatically. Basically I'm duplicating a template and editing it:

$storeId = Mage::app()->getStore()->getId(); // get store id
$product = Mage::getModel('catalog/product')->load(186);

$new = $product->duplicate();

$new->setSku(date('YmdHis'));
$new->setData("url_path", "$name.html");

$new->setEnableGooglecheckout(0);
$new->setIsImported(0);
$new->setLinksExist(false);
$new->setDescription($desc);
$new->setMetaKeyword($desc);
$new->setCustomLayoutUpdate(NULL);
$new->setName($name);
$new->setMetaTitle($desc);
$new->setMetaDescription($desc);
$new->setLinksTitle("Visitenkarten");
$new->setWebsiteIds(array(1));
$new->setData("links_exist", "1");

$new->setStockData(array(
                   'use_config_manage_stock' => 0,
                   'manage_stock'=>1,
                   'min_sale_qty'=>1,
                   'max_sale_qty'=>2,
                   'is_in_stock' => 1,
                   'qty' => 999
               )
);

$new->setState(1);
$new->save();

In my admin panel, the new product does show up, but the "Quantity" is empty. When I edit the product in the admin panel and save it, a "0" shows up in the Quantity field.

Can anyone help me with this?

EDIT:
The question my answer has been marked a duplicate of isn't describing the same error. The code in this question is already throwing an error on execution, but my code is just creating a product only showing up on the admin panel.


texts: Calling Media browser though Query error -require.exec is not a function

texts:
I'm trying to call the media browser from the CKEditor adapter. where I want to upload images. But when I do, it loads up the media gallery, and then closes it and give me back an error - require.exec is not a function
I define I have
define([
    'jquery',
    'underscore',
    'Ereactor_CKEditor4/js/ckeditor4/ckeditor',
    'prototype',
    'mage/adminhtml/browser',
    'mage/adminhtml/events',
    'jquery/ui'
]

when I call it
if(target.is('img')){
MediabrowserUtility.openDialog("cms/wysiwyg_images/index", 0, 0, "MediaBrowser", {});
 }

Anybody who has any idea why?


texts: How does the grouped product module display the linked position attribute?

texts:
I'm trying to replicate the functionality of the grouped-product module and can't seem to understand how it displays the linked attribute position. When adding my own linked product attribute which has data associated to the associated products I only see empty values. However, if I echo out $linkItem->getExtensionAttributes()->getMytestattribute() in the fillData() function I see the values on my screen.

Magento\GroupedProduct\Ui\DataProvider\Product\Form\Modifier\Grouped

I see this:

protected function fillData(ProductInterface $linkedProduct, ProductLinkInterface $linkItem)
{
    ....
    return [
        ....
        'position' => $linkItem->getPosition(),
        ....
    ];
}

And this:

/**
 * Fill meta columns
 *
 * @return array
 */
protected function fillMeta()
{
    return [
        ....
        'position' => [
            'arguments' => [
                'data' => [
                    'config' => [
                        'dataType' => Form\Element\DataType\Number::NAME,
                        'formElement' => Form\Element\Input::NAME,
                        'componentType' => Form\Field::NAME,
                        'dataScope' => 'position',
                        'sortOrder' => 100,
                        'visible' => false, //change to true and it shows this field with the assigned values for position
                    ],
                ],
            ],
        ],
    ];
}

However, I don't see position inside of \view\adminhtml\ui_component\grouped_product_listing.xml. I want to achieve the same thing by adding a linked product attribute to a new column for the associated products grid and not the popup where you add more products to the grid.

What am I missing here??

Update:
I figured out you can add 'value' => 'My data should populate here' to the fillMeta function for the new column but not sure how to pass data to that field or even if this is the correct way to pass data to this new column?

Example:

    'mytestattribute' => [
        'arguments' => [
            'data' => [
                'config' => [
                    'dataType' => Form\Element\DataType\Number::NAME,
                    'formElement' => Form\Element\Input::NAME,
                    'componentType' => Form\Field::NAME,
                    'dataScope' => 'mytestattribute',
                    'label' => __('My Test Attribute'),
                    'fit' => true,
                    'sortOrder' => 85,
                    'value' => 'My data should populate here',
                    'validation' => [
                        'validate-number' => true,
                    ],
                ],
            ],
        ],
    ],


texts:
I have a secondary website under the root folder.
I have example.com as the main domain. Create a new website with website code ir. And the url links to ir folder. Added .htaccess and index.php with the modification as per the website load. Created symbolic links ln -s /var/www/html/example/app/ app etc. Still after doing all this when i load the secondary site example.com/ir the css url are example.com/ir/pub/static/frontend/Magento/blank/en_GB/css/styles-m.css which does not exist.


texts: Remove custom attribute from attribute set programatically magento2

texts:
I am trying to create a custom attribute and add it to a custom created attribute set. The problem is that it is being added to the Default attribute set. How can I make it only appear in my attribute set?
Below is the code I am using in the upgrade script.

/* @var Magento\Eav\Setup\EavSetup $eavSetup */
$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
if (version_compare($context->getVersion(), '1.0.2', '<')) {
    $data = array (
       'type' => 'string',
       'label' => 'Designer',
       'input' => 'text',
       'required' => false,
       'sort_order' => 3,
       'global' => ScopedAttributeInterface::SCOPE_GLOBAL,
       'group' => 'Product Details',
       'used_in_product_listing' => true,
       'visible_on_front' => true,
    );
    $attributeSet = 'Test-Attribute-Set';

    $entityTypeId = $this->coreRegistry->registry('entityType');
    $eavSetup->addAttribute(
        \Magento\Catalog\Model\Product::ENTITY,
        'designer',
        $data
    );
    $eavSetup->addAttributeToSet(
        $entityTypeId,
        $attributeSet,
        'Product Details',
        'designer'
    );
}


texts: I have just realized that my site has somehow started displaying a products price with 'US' infront of it. I am not sure why all of a sudden its doing this never the less is there a way to quickly change this?


texts:
Edited Question

After the suggestion from Khoa TruongDinh I made changes in savePaymentInformationAndPlaceOrder() and followed this to implement order splitting but it's not working can anyone suggest me my mistakes.

Previous Question

I want to split order depending on no of items in Magento 2. I know in Magento 1.x it is possible by rewriting saveOrder() of Magento\Checkout\Model\Type\Onepage I tried the same way in Magento 2 but it is not working. I also tried to make changes directly in the core file for testing purpose only, but system not visiting saveOrder().

Can anyone please tell me why this is not visiting.

I enabled Onepage Checkout configuration in Admin.


texts:
I'm wondering what is the best way to accomplish inventory management for a magento store that sells custom made t shirts.

The store has several designs the user can choose to be printed on the t shirt  (each design is currently registered as a configurable product). And user can choose color and size. So far it's all working great. The problem is that I want to control my stock of t shirt's size and colors and this inventory must be shared between all products. So independently of which design (product) was ordered the inventory should be reduce based only on the size and color ordered.

If I run out of size L blue t shirts it should set all products to out of stock for this particularly size and color.

Is there a way to do that?

Thanks.


texts: Allowed countries keeps resetting to all

texts:
I have an issue in Magento 1.9.0.1 where my allowed countries keep showing every country in the frontend.

I did a search and came across this: Allow countries keeps resetting and allowing all on frontend?

I tried the XML updates, but that didn't do anything.

I disabled the cache and it went back to normal. I discovered that if I have cache enabled and then reindex, the problem will show up and persist until I flush the cache.

Any idea what the issue could be?

Thanks


texts: observer not firing when saving product programatically

texts:
I have 2 observers, catalog_product_prepare_save and catalog_product_save_after that work great when I save a product from admin or when a product is saved through a sale of the product. However they're not begin called from a script I wrote to update some data.

Script not calling observer:

$_product = Mage::getModel('catalog/product')->load($ProductID);
$_stockItem = $_product->getStockItem();

$_stockItem->setData('manage_stock', 1);
$_stockItem->setData('is_in_stock', 0);
$_stockItem->save();

$_product->setData($Attribute, $NewValue);
$_product->save();

My Observer xml file:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Vampower_MyObserver>
            <version>0.0.1</version>
        </Vampower_MyObserver>
    </modules>

    <global>
        <models>
            <Vampower_MyObserver>
                <class>Vampower_MyObserver_Model</class>
            </Vampower_MyObserver>
        </models>

        <events>
            <catalog_product_prepare_save>
                <observers>
                    <Vampower_MyObserver>
                        <class>Vampower_MyObserver/observer</class>
                        <method>UpdateInfo</method>
                        <type>singleton</type>
                    </Vampower_MyObserver>
                </observers>
            </catalog_product_prepare_save>

            <catalog_product_save_after>
                <observers>
                    <Vampower_MyObserver>
                        <class>Vampower_MyObserver/observer</class>
                        <method>qtyUpdate</method>
                        <type>singleton</type>
                    </Vampower_MyObserver>
                </observers>
            </catalog_product_save_after>
        </events>
    </global>
</config>


texts: Need to translate Tax word in Swedish as Moms

texts:
I want to translate the word Tax in order summary

I have tried adding translation in i18n

But still no result
here is the code:


texts:
carts/mine/payment-information?api=1
I am using this

<?php
$addressInformation                        = new \stdClass();
$addressInformation->cart_id               = $quoteId;
$shipping_address                          = new \stdClass();
$shipping_address->region                  = $addressInfo['region'];
$shipping_address->country_id              = $addressInfo['country_id'];
$shipping_address->street                  = array($addressInfo['street']);
$shipping_address->telephone               = $addressInfo['telephone'];
$shipping_address->postcode                = $addressInfo['postcode'];
$shipping_address->city                    = $addressInfo['city'];
$shipping_address->firstname               = $addressInfo['firstname'];
$shipping_address->lastname                = $addressInfo['lastname'];
$shipping_address->email                   = $addressInfo['email'];
$shipping_address->save_in_address_book    = 0;
$addressInformation->billing_address       = $shipping_address;
$addressInformation->paymentMethod         = new \stdClass();
$addressInformation->paymentMethod->method = $this->_payment_method;

This gives an error unable to place order try again later.


texts: Magento2 : How to create group of fileds on admin config

texts:
I am trying to create a group of options please see attached image

I have tried by adding single field but it's creating separate filed, i need similar solution either in magento1 or magento2.


texts: How to add products to cart from home page in magento2?

texts: I want to add products to cart from home page using ajax and it doesn't reload the page or doesn't redirect to any other page and the reflection i.e, count of the add to carts should be displayed properly.


texts:
I am using magento 1.8.
I have custom theme. I am unable to get newsletter error/success messages when customer submit their email-id for subscription.

I have done many changes to get and print messages. But it won't work.

I am getting messages by below code

$messages = Mage::getSingleton('core/session')->getMessages(true);
    echo "<pre>"; var_dump($messages);

object(Mage_Core_Model_Message_Collection)#281 (2) {
  ["_messages":protected]=>
  array(0) {
  }
  ["_lastAddedMessage":protected]=>
  object(Mage_Core_Model_Message_Error)#120 (6) {
    ["_type":protected]=>
    string(5) "error"
    ["_code":protected]=>
    string(102) "Il y a eu un problème lors de l'inscription : This email address is already assigned to another user."
    ["_class":protected]=>
    string(0) ""
    ["_method":protected]=>
    string(0) ""
    ["_identifier":protected]=>
    NULL
    ["_isSticky":protected]=>
    bool(false)
  }
}

But I am unable to print it.
I have tried below code.

   foreach($messages->getItems() as $message) {
        echo $message->getText();
}

Even I am not getting any thing in forloop.
Help me,, Thanks in advance:)


texts:
I am trying to run two mysql queries and export the results into a CSV.

My issue is the second query I have is being written to a new row instead of just onto the same rows that the result from the prior query gets written to.

I also can not  join the two queries because the second query I am running might not have a matching row.
Below is my code

   //Load Magento
  require_once('app/Mage.php'); //Path to Magento
  umask(0);
  Mage::app();

  //database connection
 $connection = Mage::getSingleton('core/resource')->getConnection('core_read');

$sql = "SELECT sales_flat_order.entity_id, sales_flat_order.created_at, sales_flat_order.increment_id AS OrderID,
        sales_flat_order.status, sales_flat_order_address.firstname, sales_flat_order_address.lastname,
        sales_flat_order_address.city, sales_flat_order_address.region, sales_flat_order_address.postcode,
        sales_flat_order_payment.method AS payment_method, sales_flat_order_payment.base_amount_paid AS pmt, sales_flat_order_payment.base_amount_authorized AS charged,
        sales_flat_order_payment.base_shipping_captured AS shipping_invoice
        FROM sales_flat_order, sales_flat_order_payment, sales_flat_order_address
        WHERE MONTH(sales_flat_order.created_at) = 3 AND sales_flat_order.status IN('complete','closed') AND
        sales_flat_order.entity_id = sales_flat_order_payment.entity_id AND sales_flat_order.entity_id = sales_flat_order_address.parent_id";
$list = $connection->fetchAll($sql);

//$headers = array();
$headers = array("entity_id", "created_at", "OrderID", "Status", "firstName", "LastName", "City", "State", "Zipcode", "Pmt Method", "PMT", "Charged", "Shipping Invoice", "TaxCode", "TaxRate", "Tax Amt");

$fp = fopen('php://output', 'w');
if ($fp && $list)
{
    header('Content-Type: text/csv');
    header('Content-Disposition: attachment; filename="salestax_report.csv"');
    header('Pragma: no-cache');
    header('Expires: 0');
    fputcsv($fp, $headers);
    foreach ($list as $fields)
    {

        fputcsv($fp, $fields);

        $entity_id = $fields['entity_id'];
        $sqlb = "SELECT code AS taxcode, percent AS taxrate, amount as taxamount FROM sales_order_tax
                 WHERE order_id = $entity_id";
        $listb = $connection->fetchAll($sqlb);
        foreach ($listb as $fieldsb)
         {
           fputcsv($fp, $fieldsb);
         }

    }
    die;
}


texts:
I want to modify page title of customer login.
What is the simple way to modify page title?

/**
 * @return $this
 */
protected function _prepareLayout()
{
    $this->pageConfig->getTitle()->set(__('Customer Login'));
    return parent::_prepareLayout();
}


texts:
TAX ZONE AND RATES

I have set 0% for active union vat and 19% for non-active union vat
https://prnt.sc/ssiam3

TAX RULES:
here I add a rule:
https://prnt.sc/ssibau

Now I create customer group:
Wholesaler Active Union VAT and here I assigned tax classes Active Union VAT 0%:
https://prnt.sc/ssibpr

Now I created a new user and assign it to this group with VAT 0%.

Now when I try to place order still Magento add tax 19%
https://prnt.sc/ssickm

Any solution?


texts: We need REST API's to build mobile application. I am beginner of rest api. How to write REST API for Magento-1.9.?


texts: Getting Sku of bundle-product options in carts/mine/items

texts:
Suppose I added one bundle product in cart.When I call \carts\mine\items,it show respnse of bundle options

"extension_attributes": {
        "bundle_options": [{
            "option_id": 643,
            "option_qty": 1,
            "option_selections": [704]
            }, {
            "option_id": 644,
            "option_qty": 1,
            "option_selections": [705]
            }, {
            "option_id": 645,
            "option_qty": 1,
            "option_selections": [706]
            }]
        }

Can I get sku of bundle option also?

Please suggest me.


texts: PHP extension "mcrypt" must be loaded but other installs work

texts:
I currently have working copy of Magento installed on my machine. I am now trying to install another copy. The new install has thrown the error

PHP extension "mcrypt" must be loaded.

I can only assume that it is looking at a different file to what the other install is looking at.

How do I find where the working install is looking?

NB:

Comparing the two I can see the working one has local.xml in app/etc folder and the new install does not, is this automatically created on the install? I assume I can't copy and paste it due to this line of code

<crypt>
            <key><![CDATA[89a7677964ad4d3e338b9ca5978f9ad5]]></key>
        </crypt>

EDIT

In both installed version and version im trying to install echo phpinfo() showed mcrypt was not being used and shows

Configuration File (php.ini) Path   /etc

this is different to the file path shown in the next command I made

so I ran php --ini on the cli and it displayed this

myName@myMac:~ » php --ini
Configuration File (php.ini) Path: /usr/local/etc/php/5.4
Loaded Configuration File:         /usr/local/etc/php/5.4/php.ini
Scan for additional .ini files in: /usr/local/etc/php/5.4/conf.d
Additional .ini files parsed:      /usr/local/etc/php/5.4/conf.d/ext-ioncubeloader.ini,
/usr/local/etc/php/5.4/conf.d/ext-lzf.ini,
/usr/local/etc/php/5.4/conf.d/ext-mcrypt.ini,
/usr/local/etc/php/5.4/conf.d/ext-memcache.ini

It seems there are two php installs how would I point my currently install copy of Magento to use the correct one and how would I tell the new install to look in that folder? or should I simply drag files from

/usr/local/etc/php/5.4
/usr/local/etc/php/5.4/php.ini
/usr/local/etc/php/5.4/conf.d
/usr/local/etc/php/5.4/conf.d/ext-ioncubeloader.ini,
/usr/local/etc/php/5.4/conf.d/ext-lzf.ini,
/usr/local/etc/php/5.4/conf.d/ext-mcrypt.ini,
/usr/local/etc/php/5.4/conf.d/ext-memcache.ini

to

/etc

?


texts:
I'm using a minimal modified Magento CE 2.2.7 with a free Solwin template, nothing fancy.

When I add products, Magento automatically rounds up the prices.
eg:

€2.30 becomes €2
€2.60 becomes €3

I understand this is a feature, one that should not be active by default.
It however is enabled by default. I have tried several plugins that are made for manipulating the rounding mechanism, which also gives me the option to disable rounding (https://packagist.org/packages/faonni/module-price for example) but these don't seem to have any effect, the problem persists.

The exact same problem is described here, but no logic answer has been provided: https://github.com/magento/magento2/issues/12210
"Found the issue was due to the precision being automatically set to 2 and bootstrap.php being ignored changed it on server level to 14 and issue resolved" is not something I can translate in to specific actions.

Can anybody point me in the right direction? Everything else seem to work just fine and we are getting to production state, so reinstalling isn't really an option at this point.

Thanks in advance!


texts: observer to fire on system admin config display

texts:
In my plugin I'm trying to create an event observer that should fire when I display my plugin system configuration page.
At first I created a new db table f24_staging by \Vendor\MyApp\Setup\UpgradeSchema.php
I launched php bin/magento setup:upgrade from the terminal and it's ok;
This is the complete path of system.xml: \Vendor\MyApp\etc\adminhtml\system.xml
I already have got events.xml in the parent folder, that is \Vendor\MyApp\etc\events.xml
for example, here I catch the customer registration process
<event name="customer_register_success">
        <observer name="sMSHandleCustomerSaveAfter" instance="Vendor\MyApp\Observer\CustomerRegisterObserver" />
    </event>

I tried to create a new event in the same events.xml file, like this:
<event name="admin_system_config_changed_section">
        <observer
            name="templates_list"
            instance="Vendor\MyApp\Observer\F24ApiOptionsObserver"
        />
    </event>

then I created my F24ApiOptionsObserver under Vendor\MyApp\Observer, like this:
class F24ApiOptionsObserver implements \Magento\Framework\Event\ObserverInterface
{
 public function __construct(
        \Vendor\MyApp\Helper\Data $helper,
        \Psr\Log\LoggerInterface $logger
     )
     {
         $this->helper = $helper;
         $this->_logger = $logger;
     }
public function execute(\Magento\Framework\Event\Observer $observer)
{
    $event = $observer->getEvent();
    $this->_logger('event :', $event);
    $objectManager =   \Magento\Framework\App\ObjectManager::getInstance();
    $resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
    $connection = $resource->getConnection('\Magento\Framework\App\ResourceConnection::DEFAULT_CONNECTION');
    $f24_staging = $resource->getTableName('f24_staging');
    $storeId = (int) $this->getRequest()->getParam('store', 0);
    $apiKey = $this->helper->getConfig('myapp/generali/api_key', $storeId);
    $templates_res = $this->helper->apiCall('https://www.app.myapp.com/api/v0.3/GetTemplate', $apiKey);
    $templates_xml = simplexml_load_string(utf8_encode($templates_res));
    $json_templates = json_encode($templates_xml);
    $this->helper->trace('elenco templates :', $json_templates);
    $insert = "insert into $f24_staging set id_api_call='1',f24_options_value='$json_templates'";
    $connection->query($insert);
}

}

The observer should add data to my custom db table when I display system admin config page, but the event is not firing. Anyone could help me?


texts: how to remove certain code from home page? where is the actual home page file in file manager or ftp?

texts:
idrisbookbank.com

i had this malware attack. which inserted google ads code in my home page and whenever user browse through mobile or desktop they could not click my buttons but the ad opens, Checking the source code clearly shows the google ads code but i dont know the location of the file which i can open and delete the code. and yes i have secured my site and changed the passwords. magento 1.7 yes its outdated.

code is this

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

     (adsbygoogle = window.adsbygoogle || []).push({});


texts: Place order directly by adding product to cart Magento 2

texts:
I want to place order programmatically by adding a product from Product view page, without showing cart and checkout.

Please suggest.


texts: Magento 2 : Override block file Magento\ConfigurableProduct\Block\Product\View\Type\Configurable.php

texts:
How to override function getAllowProducts() from Magento\ConfigurableProduct\Block\Product\View\Type\Configurable.php in magento 2.

I want to override above function but not getting changes of function and nothing display any issue.
There are no any error display inside log file.

i will share my code here,

registration.php file,

<?php

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Test_Configuration',
    __DIR__
);

etc folder,

module.xml

code is,

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
  <module name="Test_Configuration" setup_version="1.0.0"/>
</config>

i have override block inside
    di.xml code is

<?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\ConfigurableProduct\Block\Product\View\Type\Configurable" type="Test\Configuration\Block\Outstock" />
</config>

Block folder,
Outstock.php file,

<?php
namespace Test\Configuration\Block;

class Outstock extends \Magento\ConfigurableProduct\Block\Product\View\Type\Configurable
{
    public function getAllowProducts()
    {
        if (!$this->hasAllowProducts()) {
            $products = [];
            $skipSaleableCheck = $this->catalogProduct->getSkipSaleableCheck();
            $allProducts = $this->getProduct()->getTypeInstance()->getUsedProducts($this->getProduct(), null);
            foreach ($allProducts as $product) {
                    $products[] = $product;
            }
            $this->setAllowProducts($products);
        }
        return $this->getData('allow_products');
    }

    protected function _toHtml()
    {
        $this->setModuleName($this->extractModuleName('Magento\ConfigurableProduct\Block\Product\View\Type\Configurable'));
        return parent::_toHtml();
    }
}

i havent any error display not any log generate for this file and module is activated. inside setup_module entry are generated.

Any suggestion for override function of configurable.php file.

Thanks.


texts: Fatal error: Call to a member function collect() on a non-object in app/code/core/Mage/Sales/Model/Quote/Address.php on line 1013

texts:
we are getting this error in frontend of the site.

Fatal error: Call to a member function collect() on a non-object in /var/www/html/sitenanme/app/code/core/Mage/Sales/Model/Quote/Address.php on line 1013

This is complete code : http://pastebin.com/KkHCm0zG

''This is the code from  Address.php line 1000 to 1030."

'

public function getTotalModels()
{
        return $this->getTotalCollector()->getRetrievers();
    }

    /**
     * Collect address totals
     *
     * @return Mage_Sales_Model_Quote_Address
     */
    public function collectTotals()
    {
        Mage::dispatchEvent($this->_eventPrefix . '_collect_totals_before', array($this->_eventObject => $this));
        foreach ($this->getTotalCollector()->getCollectors() as $model) {
            $model->collect($this);
        }
        Mage::dispatchEvent($this->_eventPrefix . '_collect_totals_after', array($this->_eventObject => $this));
        return $this;
    }

    /**
     * Get address totals as array
     *
     * @return array
     */
    public function getTotals()
    {
        foreach ($this->getTotalCollector()->getRetrievers() as $model) {
            $model->fetch($this);
        }
        return $this->_totals;
    }


texts: M2 how to add a custom css only to a module override?

texts:
I need to apply this code to checkout page:

.header-wrapper-content.sticky-menu.active{display:none;}
.hdmx__contact-button.hdmx__contact-button-right{display:none;}

This hide the sticky menu and the float contact us module from the checkout.

How can I apply this only to the checkout page?

I already tried to create
"app/design/frontend/your-store/your-theme/Magento_Checkout/web/css/source/_extend.less"

where "_extend.less" file contains the CSS above, but in this way, the style is applied to the whole site.

I need to have that code only on during checkout.


texts: I am curious as to how to edit content in the body of my Magento website. I can find and edit the header and footer with ease, but if there's anything in the body I seem to get lost as to how I can alter things. Why can't it just be as easy as hitting the delete button when using firebug:p


texts: How can I load Billing address from sales_flat+order_address first then shipping after?

texts:
I've been trying for hours to load the billing address  from the sales_flat_order_address table then I would like to get the shipping address but for some reason the shipping loads first.

I'm using the parent_id to load the model and I'd expect the billing row to load first but it isn't. For some reason it skips over the billing address and loads the shipping data first then come back for the billing address after.

Does anyone know what I'm doing wrong here?


texts: Magento2 Free Shipping method is not shown

texts:
I have enabled Free Shipping method in the back-end and no other method is enabled.

When I checkout adding just one product, sometimes the free-shipping method is shown and some-times it is not.
besides there is a message above free shipping method as

"No quotes is available for this order at this time"

but still I am able to checkout without any issue when Free shipping Method is shown.

I also observed that when I add more than 1 product, the shipping method is invariably shown without any issue.

What could be the reason for this?

I have not added any shipping rule.


texts: How to create a new page layout with 4 columns?

texts:
I'm trying to achieve exercise 3.6.9 of "Core Principles for Theming in Magento 2" from Magento U.

In my custom theme, I have this tree structure :

|-- Magento_Theme
|   |-- layouts.xml
|   `-- page_layout
|       `-- 4columns.xml

layouts.xml contains :

<?xml version="1.0" encoding="UTF-8"?>
<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd">

    <layout id="4columns">
        <label translate="true">4 columns</label>
    </layout>

</page_layouts>

And 4columns.xml contains :

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

    <update handle="3columns"/>

    <referenceContainer name="4columns">
        <container name="fourth.column" htmlTag="div" htmlClass="fourth-column" after="-" >
        </container>
    </referenceContainer>

</layout>

When I select the "4 columns" layout in "Content > Pages > Home Page", I get a white screen in the frontend homepage. What's wrong with this code ?

I'm doing my tests with a fresh install of Magento 2.2.0 with sample data. My homepage is set to display a widget with new products list when it works, which works fine when selecting other default layouts.


texts: Magento 2 : Unable to generate Price for programmatically created 'custom product'

texts:
I have created a custom product for which I am able programmatically create products.

The problem is that i am unable to generate a price for these products. the field is left blank when the product is created.

This is how I create the product:

$_product = $this->productFactory->create();

            $_product->setName($array['ProductName']);
            $_product->setTypeId('Dome');
            $_product->setAttributeSetId(4);
            $_product->setSku('test-SKU');
            $_product->setWebsiteIds(array(1));
            $_product->setVisibility(4);
            $_product->setPrice(array(350));
            $_product->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED);
            $_product->setStockData(array(
                    'use_config_manage_stock' => 0, //'Use config settings' checkbox
                    'manage_stock' => 1, //manage stock
                    'min_sale_qty' => 1, //Minimum Qty Allowed in Shopping Cart
                    'max_sale_qty' => 2, //Maximum Qty Allowed in Shopping Cart
                    'is_in_stock' => 1, //Stock Availability
                    'qty' => 100 //qty
                    )
                );

            $product = $this->productRepository->save($_product);

            $id = $product->getId();

            return $id;

I have also tried this to no avail:

  $_product->setPrice(350);

This is how the custom product was created:

  product_types.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/product_types.xsd">
    <type name="Dome" label="Event Dome Product" modelInstance="Mymodule\Example\Model\Product\Type\EventDome"
          composite="false" isQty="true" canUseQtyDecimals="false" sortOrder="83">
        <priceModel instance="Mymodule\Example\Model\Product\Type\Price"/>
        <customAttributes>
            <attribute name="refundable" value="true"/>
            <attribute name="is_real_product" value="false"/>
            <attribute name="taxable" value="true"/>
        </customAttributes>
    </type>
</config>


texts: How can I add the filter_condition_callback argument via layout.xml instruction in Magento 1.9?

texts:
I have added a sales order grid column using the following layout.xml
<layout>
    <!-- main layout definition that adds the column -->
    <add_order_grid_column_handle>
        <reference name="sales_order.grid">
            <action method="addColumnAfter">
                <columnId>order_comment</columnId>
                <arguments module="vendor_ordergridcolumns" translate="header">
                    <header>Order Comment</header>
                    <index>order_comment</index>
                    <type>text</type>
                    <sortable>false</sortable>
                    <renderer>Vendor_OrderGridColumns_Block_Adminhtml_Sales_Order_Grid_Renderer_Comment</renderer>
                    <filter_condition_callback><!-- How should I put it here? -></filter_condition_callback>
<!--                    <width>200px</width>-->
                </arguments>
                <after>status</after>
            </action>
        </reference>
    </add_order_grid_column_handle>

    <!-- order grid action -->
    <adminhtml_sales_order_grid>
        <!-- apply the layout handle defined above -->
        <update handle="add_order_grid_column_handle" />
    </adminhtml_sales_order_grid>

    <!-- order grid view action -->
    <adminhtml_sales_order_index>
        <!-- apply the layout handle defined above -->
        <update handle="add_order_grid_column_handle" />
    </adminhtml_sales_order_index>
</layout>

Now I would like to add a filter_condition_callback function to the column but I'm not sure how to add it in the xml instruction.
Normally in a grid php file it would be an array [$this, <name_of_function>]


texts: Can you tell me from where it comes discount in Magento 2 order items

texts:
I see it show discount in Magento 2 admin order details page . But I am unable to find out the reason of discount . There is no catalog price rule applied. Can anyone give me idea how i can find out that ?

Please look image I attach so you can understood .


texts: product_type_data not working in List Page

texts:
I am using the following codes in list page which has been written in details page to display the configurable product. But the issue is the bellow codes are not working in list.phtml page.

<?php echo $this->getChildHtml('alert_urls') ?>
<?php echo $this->getChildHtml('product_type_data') ?>
<?php echo $this->getChildHtml('bundle_prices') ?>
<?php echo $this->getTierPriceHtml() ?>


texts:
Is there an actual way to handle the columnCount in Magento's 1.9 RWD theme?

It is not possible to use addColumnCountLayoutDepend in layout.xml to set the column counts depending on the page layout in this theme and is only used to set the maximum columns.

I can manually set $_columnCount = 2; in the list.phtml and whilst $_columnCount; outputs 2, the columns on the front end don't actually change.

I see that the widths (%) for the <li> items are all hardcoded in styles.css to 4 decimal places - surely there is a way to handle this without altering all the widths in the stylesheet to get the amount of products per row you want in your grid?

Even if it were a case of altering all the widths, how do you get this perfect with 4 decimal places like so:-

width: 30.8642%;
margin-right: 3.7037%;

I'm sure I must be overlooking something else?


texts:
I want to set the order status from pending to completeafter it got shipped out without creating an invoice.

Reason for this is, that we create invoices with our ERP. If we keep the Magento 2 invoices enabled, the customer would have two invoices with two different order numbers.

How can I disable the invoice in Magento 2 or change its status to complete?


texts: How can I get user information from JWT tocken?

texts:
I'm react-native developer, I'm new to Magento, REST and OAuth. I want to use the Magento 2.0 OAuth REST API to login into my app
I am getting this token as shown in the image, how can I use this token to do login authentication in react native application?


texts: Magento 2 Add Custom options to Bundle Product add options

texts:
When Admin Create an Bundle Product at that time We have Bundle Options box which generated when we click on Add Options

I want to Add Custom Field into this bundle options box.

Any Suggestion like from where and how to add custom field.


texts:
I have a piece of javascript that acts upon the reloadPrice function. It inserts a block of html into the dom to add a corresponding sample product (cloth sample for sofas). This works fine so far.

But to make sure a sample does not get added to cart more than once I need to access the quote (check items) via javascript. Now I am struggeling how to do it.

This is my code:

define([
    'jquery',
    'mage/translate',
    'Magento_Checkout/js/model/quote',
    'mage/utils/wrapper'
], function ($, $t, quote, wrapper) {
    'use strict';

    return function(targetModule){

        var reloadPrice = targetModule.prototype._reloadPrice;
        var reloadPriceWrapper = wrapper.wrap(reloadPrice, function(original) {
            var result = original();

            var simple = this.options.spConfig.children[this.simpleProduct];

            if (typeof simple != 'undefined') {
                if (simple.sample != '') {

                    console.log(quote.getItems);

                    if ($('#order-sample').length) {
                        $('#order-sample').replaceWith(simple.sample);
                    } else {
                        $('#product-options-wrapper').after(simple.sample);
                    }
                    $('#sample-add-to-cart').catalogAddToCart({
                        addToCartButtonTextDefault: $.mage.__('Order a cloth sample')
                    });
                } else {
                    $('#order-sample').remove();
                }
            }

            return result;
        });

        targetModule.prototype._reloadPrice = reloadPriceWrapper;
        return targetModule;
    };
});

My idea was to inject Magento_Checkout/js/model/quote and check the quote's items using getItems. Unfortunately this does only work inside the cart/checkout. When I use it like above I get the error TypeError: window.checkoutConfig is undefined in the console.

So my question is: how can I access the cart/quote and it's items outside checkout via javascript.

Thank you


texts: Magento 2 Add to cart one product with different size at once but seems as one product

texts:
I have created one module in which we can directly add products to cart using SKUs with different configuration options

but when i added it shows one product in cart with last option i selected and 2 qty.

I want to add same product with different options and quantities.

Proocess which generate an Array like this which i pass to store in cart :

Array(
[0] => Array(
        [WT09] => Array(
                [product] => 1817
                [sku] => WT09
                [qty] => 1
                [super_attribute] => Array
                    (
                        [141] => 167
                    )
            )
    )
[1] => Array(
        [WT09] => Array(
                [product] => 1817
                [sku] => WT09
                [qty] => 1
                [super_attribute] => Array
                    (
                        [141] => 171
                    )
            )
    ))

any idea on how to solve this issue?


texts: Error when installing a plugin in magento 2.2

texts:
I am installing a plugin but when I say I get a permission error, how can I fix it?

I attached a screenshot of what I did to install it


texts: I want to clear category page cache when third party does not return any response and it should be just one time when response 200 i have to clear category page cache again.How to clear specific block cache in magento2 based on third party api response?


texts: Show only filters in layered navigation for search results where all products have that filter populated

texts:
I am trying to implement this feature:
the filters that are shown in the search results page are only visible if every products in that results page have the attribute linked with the filter populated.
For instance, a search result have 2 products:

product A with attribute Attribute1 and Attribute2 both populated
Product B with only the Attribute1 populated

I would like that the filter shown in the search result is only the filter of the Attribute1 (because the product B doesn't have the Attribute2 populated).
I already did this with the layered navigation on categories,
by modifying the following file:

/var/www/html/magento/vendor/magento/module-layered-navigation/view/frontend/templates/layer/view.phtm

in the following way:
<?php
/**
 * Copyright Â© Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
?>
<?php
/**
 * Category layered navigation
 *
 * @var $block \Magento\LayeredNavigation\Block\Navigation
 */
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$category = $objectManager->get('Magento\Framework\Registry')->registry('current_category');
?>

<?php if ($block->canShowBlock()) : ?>

            <?= $block->escapeHtml(__('Shop By')) ?>

            <?= $block->getChildHtml('state') ?>

            <?php if ($block->getLayer()->getState()->getFilters()) : ?>

                    <a href="<?= $block->escapeUrl($block->getClearUrl()) ?>" class="action clear filter-clear"><?= $block->escapeHtml(__('Clear All')) ?>

            <?php endif; ?>
            <?php $wrapOptions = false; ?>
            <?php foreach ($block->getFilters() as $filter) : ?>
                <?php if (!$wrapOptions) : ?>
                    <?= $block->escapeHtml(__('Shopping Options')) ?>

                    <?php $wrapOptions = true;
                endif; ?>
                    <?php if ($filter->getItemsCount()>1) : ?>

<?php  if($filter->getName() != __('Category')) : ?>

        <?php if ($category->getProductCollection()->count() == $category->getProductCollection() ->addAttributeToSelect('sku') ->addAttributeToFilter($block->escapeHtml(__($filter->getRequestVar())),array('notnull'=>true))->getSize()) : ?>

<?= $block->escapeHtml(__($filter->getName())) ?>

<?= /* @noEscape */ $block->getChildBlock('renderer')->render($filter) ?>

    <?php endif; ?>
<?php  else: ?>

<?= $block->escapeHtml(__($filter->getName())) ?>

<?= /* @noEscape */ $block->getChildBlock('renderer')->render($filter) ?>

<?php endif; ?>
<?php endif; ?>
            <?php endforeach; ?>
            <?php if ($wrapOptions) : ?>

            <?php endif; ?>

<?php endif; ?>

But I cannot do the same with the search result.
Can please somebody help me?
Thank you


texts: Magento 2, Cancels order after credit card payment complete

texts:
I'm facing an interesting issue.
When the customer pays with credit card, magento cancels the order automatically.
I have no idea how it happens tough.
Since i'm newbie, i couldn't find out what is wrong.
Any ideas?


texts: Custom Social share button added is not shown for configurable products

texts:
I am trying to add social share buttons for the magento2 store products. Its working fine for Simple products. But for the configurable products, a button is not shown.

Can anyone help me solving this?


texts: How to load custom CSS for individual product

texts:
I need to create a product page that looks different from the rest of my site. It needs to be an actual product in my catalogue so a custom CMS page won’t work.

I’ve set the page layout in the design tab as empty to give me a blank canvas. How do I now apply CSS to the page?

I was under the impression that I could add CSS to the Custom Layout Update box but I now understand that this is only for XML.

Is there a way I can apply custom CSS for just one page?


texts: How to know if an order is from existing customer or new customer?

texts:
I have the following code:

    $lastOrderId = Mage::getSingleton('checkout/session')
        ->getLastRealOrderId();

    $orderId = Mage::getModel('sales/order')
        ->loadByIncrementId($lastOrderId)
        ->getEntityId();

    $order = Mage::getModel('sales/order')->load($orderId);
    echo $order;
    $udo = array();
    $udo['CID'] = '123';
    $udo['TYPE'] = '123';

but I need to assign a different value to TYPE, if the order is from an existing customer or from a new one.

any idea>?


texts:
Hey guys so I have categories:
Round Pendants, Ellip Pendants, Bangles, Oval ID Bracelets

At the top in my Nav Menu it lists them correctly :)
How can I change the CSS so they all take up the same amount of space?

Since Bangles is the shortest in word length it also takes up the least amount of space.  I want all of the categories to take up the same amount of space for example to fit 5 categories on each row take up 20% width space.

The only problem is when I change CSS it messes up when the window is resized! Magento  has a cool way for when the window shrinks to a certain size it compacts it into a drop down menu of categories.

TLDR: What's a great way for categories in the nav menu to take up the same amount of space even when window resizes?

I'll be by the computer all day so feel free to ask questions for clarification and I'll respond as soon as I can! Thanks everyone!


texts: Magento 2 : Add category filter to product grid

texts:
I am just trying to add an extra filter of category on the product grid page. After following the method given here - https://chillydraji.wordpress.com/2016/11/29/add-category-filter-to-product-grid-in-magento2/comment-page-1/#comment-626
I can see a new column in my product grid containing categories in it. But from the filter box when i select any category from the dropdown and press apply filter button, an error is coming – "Invalid attribute name: category_id".

Can anyone please let me know what I am doing wrong here.


texts: Magento2 Update price automatically when quantity changed on product page

texts:
How can I update product price and custom options when user change the quantity ?
If quantity belong to tier price, price should be update accordingly.

Actually I am not able to get the product price and option object in javascript.
So how can I get the price object on custom javascript and reload the price after making custom calculation ?


texts: Index "catalog_product_flat" disappeared after update to 1.9x

texts:
After updating from 1.7.0.2 to 1.9.2.1 the catalog_product_flat index is not longer shown.

The index is neither shown in Magento Backend nor if i call

php shell/indexer.php info

It is activated under System > Config > Catalog > Catalog > Shop

I can still call it directly via

php shell/indexer.php --reindex catalog_product_flat

and the database tables are filled and used.

Any idea how it comes or to fix it?


texts: Magento 2 change product description using API on every 5 seconds

texts:
I am working on Magento2, and I've to change my product description on every five minutes using the third-party API.
Then I've 1laksh product in my Magento, so which approach is better to change the product description.

Approach1:

Create a new Magento Cron & get the product collection with some limit value(10), once the description getting updated. I'll be going to maintain a new field api_updated_time.

so it'll update the descriptions for the first 10 product and update the new field value.

In the second time Cron was running I am checking the time difference between the api_updated_time and Cron running time, based on that I am updating the next ten products.

The above is the right approach or else is there has any better method to accomplish the logic.

Kindly check and share your thoughts.


texts: How to create new website with new url on Magento 2.3.5

texts:
i want to create a new website, default website has url "abc.com"

I want to create new website with new url is "xyz.com"

How to do it, i followed How to Setup Magento 2 with Multiple Stores and Domains but it not work for me

And i try add this code to .htaccess, it also not work, please help me

SetEnvIf Host www\.abc\.com MAGE_RUN_CODE=abc_web
SetEnvIf Host www\.abc\.com MAGE_RUN_TYPE=website
SetEnvIf Host ^abc\.com MAGE_RUN_CODE=abc_web
SetEnvIf Host ^abc\.com MAGE_RUN_TYPE=website

SetEnvIf Host www\.xyz\.com MAGE_RUN_CODE=xyz_web
SetEnvIf Host www\.xyz\.com MAGE_RUN_TYPE=website
SetEnvIf Host ^xyz\.com MAGE_RUN_CODE=xyz_web
SetEnvIf Host ^xyz\.com MAGE_RUN_TYPE=website


texts: Contact form in CMS page with form.additional.info

texts:
I'm trying to add the contact form to my CMS page.
I can add

{{block class="Magento\Contact\Block\ContactForm" name="contactForm" template="Magento_Contact::form.phtml"}}

as indicated on this post but it doesn't load the form.additional.info part of the contact form.

I need that for the Re-Captcha form to show. The form.phtml does include a call to the additional info block <?php echo $block->getChildHtml('form.additional.info'); ?> but it doesn't render.

Magento's default layout for the contact us page looks like this

        <referenceContainer name="content">
            <block class="Magento\Contact\Block\ContactForm" name="contactForm" template="Magento_Contact::form.phtml">
                <container name="form.additional.info" label="Form Additional Info"/>
            </block>
        </referenceContainer>

But I can't figure out how to get the <container name="form.additional.info" label="Form Additional Info"/> into the CMS page through the layout updates XMl field.


texts: magento 2 - Set limit to the compared product

texts:
I need to set limit to the compared product, for example: max_limit 4, But now it is adding Number of products to compare list.
Kindly suggest.


texts: Does Magento store something in PHP $_SESSION or PHP $_COOKIES while customer do the login & add items to cart.?

texts:
Because of some reason i have to check customer is logged in or cart having items. using only core PHP session or cookies.

Can anyone tell Does Magento store something in PHP $_SESSION or PHP $_COOKIES while customer do the login & add items to cart?

& if yes then how can we apply this check.


texts: How to generate random password for new customer while creating account in magento 2?

texts:
I need to hide password fields and generate a random password when customer register at the store, the same thing as in this post: How to generate random password for new customer while creating account in magento?
I´d tried to change the inputs but they are not the same.

            <?= $block->escapeHtml(__('Password')) ?>

                <input type="password" name="password" id="password"
                       title="<?= $block->escapeHtmlAttr(__('Password')) ?>"
                       class="input-text"
                       data-password-min-length="<?= $block->escapeHtmlAttr($block->getMinimumPasswordLength()) ?>"
                       data-password-min-character-sets="<?= $block->escapeHtmlAttr($block->getRequiredCharacterClassesNumber()) ?>"
                       data-validate="{required:true, 'validate-customer-password':true}"
                       autocomplete="off">

                        <?= $block->escapeHtml(__('Password Strength')) ?>:

                            <?= $block->escapeHtml(__('No Password')) ?>

            <?= $block->escapeHtml(__('Confirm Password')) ?>

                <input type="password" name="password_confirmation" title="<?= $block->escapeHtmlAttr(__('Confirm Password')) ?>" id="password-confirmation" class="input-text" data-validate="{required:true, equalTo:'#password'}" autocomplete="off">


texts:
I just upgraded to Magento 2.3.5. I'm having an issue where I can't force magento 2 to read the quote from database. It stores the cart in the variable "mage-cache-storage" and reads it from there.

Any help on how to make Magento always read the active quote from the database?

This issue only appeared after I uppdated.

Thanks !


texts: Is it possible to edit each product (name color, price color, font, etc) css in category page depending on a certain attribute?

texts: I have 1 category, and 2 attributes which i can sort by, for example boys and girls and i would like the products that have 1 attribute to have certain colors, for example blue for boys and pink for girls for certain things like product name and others.


texts: Magento 2 Product detail page " The attribute 'ifconfig' is not allowed." error

texts:
I am getting below error on product detail page

  1 exception(s): Exception #0
  (Magento\Framework\Config\Dom\ValidationException): Element
  'referenceBlock', attribute 'ifconfig': The attribute 'ifconfig' is
  not allowed. Line: 1197

Magento version : 2.3.2
PHP version :7.2

I have disabled all custom module and removed "ifconfig" from my custom theme but not got any clue.

Please share your ideas what could be issue.


texts:
I took the solution from here: Magento 2.2 - adding name field to newsletter module

It is working fine on a CMS page but it is interrupting work of the standard subscribe form.

Exception message: Notice: Undefined variable: result

We have it in the footer of the website and it is not working now. Any advice on that


texts: How to display Configurable/Color Swatches in Homepage Magento 1.9.1

texts:
I have a list of products on my homepage and I'm trying to display its associated color swatches but I'm having a hard time to do it. I have the configurable swatches in my product list and it's working fine.

I'm using RWD theme and Magento 1.9.1 CE.

<script type="text/javascript">
    $j(document).on('product-media-loaded', function() {
        ConfigurableMediaImages.init('<?php echo $this->getImageType(); ?>');
        <?php foreach ($this->getProductImageFallbacks() as $imageFallback): ?>
        ConfigurableMediaImages.setImageFallback(<?php echo $imageFallback['product']->getId(); ?>, $j.parseJSON('<?php echo $imageFallback['image_fallback']; ?>'));
        <?php endforeach; ?>
        $j(document).trigger('configurable-media-images-init', ConfigurableMediaImages);
    });
</script>

in app/design/frontend//default/configurableswatches/catalog/media/js.phtml

is the cause of the problem.

But before that, I paste this in my local.xml

<cms_index_index translate="label">
    <update handle="product_list"/>
    <reference name="content">
         <block type="configurableswatches/catalog_media_js_list" name="configurableswatches.media.js.list" />
     </reference>
</cms_index_index>

Then I found out that the products don't populate its small images.
If you noticed, there's a for loop in the javascript above, but it doesn't work because getProductImageFallbacks() returns NULL.

This is what I put on my CMS content (Homepage)

{{block type="catalog/product_list" column_count="5" category_id="21" template="catalog/product/homepage-list.phtml"}}

In app/code/local/Mage/ConfigurableSwatches/Block/Catalog/Media/Js/Abstract.php line 69 in public function getProductImageFallbacks($keepFrame = null)

This $products = $this->getProducts(); gives me NULL. That's why it can't give the correct image fallback.


texts: css alignement issues text dispalying in 3 lines

texts:
please visit the link :

here "CASH ON DELIVERY" and " DELIVERY BY" part is not looking good.

means it's not like

5 business days is dispalying in 3 lines....


texts: Are shopping cart rules applied to recurring orders

texts:
My question is really the title. But here are the details we have behind the question.

Shopping cart has a configured subscription item in the cart and the cart subtotal is >= $50, gets free shipping
Shopping cart has a configured subscription item in the cart and the cart subtotal is >= $150, gets free shipping and 10% off the entire cart contents.

This I have programmed and working, however, I need these same rules applied to that recurring item when the recurrence happens.

The programming is done in the cart controller the first time through but will the cart controller run when this recurrence takes place and it is made into an order? If not how do I get it to work?


texts:
I need to export order form magento with remote scripts.

When I work in local I use:

require_once("/app/Mage.php");

Mage::init();

// Set an Admin Session
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

Mage::getSingleton('core/session', array('name' => 'adminhtml'));

$userModel = Mage::getModel('admin/user');
$userModel->setUserId(1);
$session = Mage::getSingleton('admin/session');
$session->setUser($userModel);
$session->setAcl(Mage::getResourceModel('admin/acl')->loadAcl());

$connection = Mage::getSingleton('core/resource')->getConnection('core_write');

// extract order

$collection = Mage::getModel('sales/order')
                            ->getCollection()
                            ->addAttributeToSelect('*');

foreach($collection as $order)
{
$billingStreet = $billingAddress->getStreet();
[...]
}

But if I want to connect from remote server?

I cannot find an example.


texts: Add text to dropdown list of country options billing checkout form

texts:
I would like to display the shipping costs in my dropdown list of countries (shipping) options. Preferably through a php request, as follows:

Guessing I need to add to/or modify this piece in my billing.phtml file:

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

          <?php echo $this->getCountryHtmlSelect('billing') ?>

Is there a way to display the shipping costs right after the country value?


texts: Getting Error "TypeError: Failed to fetch" While running graphql endpoint in ChromeiQL

texts:
I am running xampp server in my windows local. I setup magento 2.3.2 with sample data in it.

When i try to run graphql in ChromeiQL , it throws error "TypeError: Failed to fetch". I have been using a default magento only. No customizations.

If i try to run graphql endpoint with a remove linux server, it works fine. The issue happens in local system only, not only in my pc, other local pcs as well.

I have attached here a ref. image for the error. Document explorer is also empty. Could any one help me what could be the issue here ?

Ref. Screenshot: http://prntscr.com/pfx7gp


texts: Correct, Supported way to Add CLI Commands to Magento 2

texts:
Is there a correct, and officially supported way, to add your CLI commands to a Magento 2 module?  From what I've gathered your options are

Add your command class to the commands argument of Magento\Framework\Console\CommandList via a di.xml file
Register your command via \Magento\Framework\Console\CommandLocator::register in a registration.php file or a cli_commands.php file

None of these options are blessed with an @api. It's not clear, as extension developers, how we should add command line scripts such that they'll stick around version to version.

Does anyone know if there's an official Magento policy on The Right™ way to do this?


texts: Invalid URI error after migrating Magento but no underscore in URL

texts:
I have recently migrated my site to a new dedicated server and as part of the move have updated the URL to a new one.

I am getting an invalid URI error and have searched the forums and the wider web but only find references to URLs with underscores in them.

Neither the old URL nor the new URL contain any underscores but I get the following error when trying to access any page:

There has been an error processing your request

Invalid URI supplied

Trace:

#0 /var/www/vhosts/sconch.com/httpdocs/lib/Zend/Uri.php(143): Zend_Uri_Http->__construct('http', '/www.sconch.com...')
#1 /var/www/vhosts/sconch.com/httpdocs/app/code/core/Mage/Core/Model/Store.php(773): Zend_Uri::factory('http:/www.sconc...')
#2 /var/www/vhosts/sconch.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Front.php(332): Mage_Core_Model_Store->isCurrentlySecure()
#3 /var/www/vhosts/sconch.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Front.php(161): Mage_Core_Controller_Varien_Front->_checkBaseUrl(Object(Mage_Core_Controller_Request_Http))
#4 /var/www/vhosts/sconch.com/httpdocs/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#5 /var/www/vhosts/sconch.com/httpdocs/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#6 /var/www/vhosts/sconch.com/httpdocs/index.php(87): Mage::run('', 'store')
#7 {main}

The URL sconch.com is not yet live but can be accessed by adding the following to a hosts file:

77.240.14.81 sconch.com

77.240.14.81 www.sconch.com

Any help would be greatly appreciated!

Thanks


texts:
I am new in Magento and in Magento (Magento ver. 1.9.3.2), it show Exception of

  Invalid block type: Mage_Adminhtml_Block_Sales_Order_Totals_Subtotal(in exception.log)

And reason of that Exception Order Totals, Refund Totals and other things not show in admin.

2017-11-29T04:56:07+00:00 ERR (3):  Mage_Core_Exception: Invalid block type: Mage_Adminhtml_Block_Sales_Order_Totals_Subtotal in /var/www/vhosts/bsus.es/wehn.bsus.es/app/Mage.php:595 Stack trace: 0 /var/www/vhosts/bsus.es/wehn.bsus.es/includes/src/__default.php(28754): Mage::throwException('Invalid block t...') 1 /var/www/vhosts/bsus.es/wehn.bsus.es/includes/src/__default.php(28696): Mage_Core_Model_Layout->_getBlockInstance('Mage_Adminhtml_...', Array) 2 /var/www/vhosts/bsus.es/wehn.bsus.es/includes/src/__default.php(28731): Mage_Core_Model_Layout->createBlock('adminhtml/sales...', 'subtotal') 3 /var/www/vhosts/bsus.es/wehn.bsus.es/includes/src/__default.php(28498): Mage_Core_Model_Layout->addBlock('adminhtml/sales...', 'subtotal') 4 /var/www/vhosts/bsus.es/wehn.bsus.es/includes/src/__default.php(28464): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element)) 5 /var/www/vhosts/bsus.es/wehn.bsus.es/includes/src/__default.php(28465): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element)) 6 /var/www/vhosts/bsus.es/wehn.bsus.es/includes/src/__default.php(28465): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element)) 7 /var/www/vhosts/bsus.es/wehn.bsus.es/includes/src/__default.php(28465): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element)) 8 /var/www/vhosts/bsus.es/wehn.bsus.es/includes/src/__default.php(28465): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element)) 9 /var/www/vhosts/bsus.es/wehn.bsus.es/includes/src/__default.php(28465): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element)) 10 /var/www/vhosts/bsus.es/wehn.bsus.es/includes/src/__default.php(28469): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element)) 11 /var/www/vhosts/bsus.es/wehn.bsus.es/includes/src/__default.php(14260): Mage_Core_Model_Layout->generateBlocks() 12 /var/www/vhosts/bsus.es/wehn.bsus.es/includes/src/__default.php(14185): Mage_Core_Controller_Varien_Action->generateLayoutBlocks() 13 /var/www/vhosts/bsus.es/wehn.bsus.es/includes/src/Mage_Adminhtml_Controller_Action.php(275): Mage_Core_Controller_Varien_Action->loadLayout(NULL, true, true) 14 /var/www/vhosts/bsus.es/wehn.bsus.es/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreditmemoController.php(233): Mage_Adminhtml_Controller_Action->loadLayout() 15 /var/www/vhosts/bsus.es/wehn.bsus.es/includes/src/__default.php(14334): Mage_Adminhtml_Sales_Order_CreditmemoController->newAction() 16 /var/www/vhosts/bsus.es/wehn.bsus.es/includes/src/__default.php(18813): Mage_Core_Controller_Varien_Action->dispatch('new') 17 /var/www/vhosts/bsus.es/wehn.bsus.es/includes/src/__default.php(18343): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http)) 18 /var/www/vhosts/bsus.es/wehn.bsus.es/includes/src/__default.php(21279): Mage_Core_Controller_Varien_Front->dispatch() 19 /var/www/vhosts/bsus.es/wehn.bsus.es/app/Mage.php(683): Mage_Core_Model_App->run(Array) 20 /var/www/vhosts/bsus.es/wehn.bsus.es/index.php(83): Mage::run('', 'store') 21 {main}

any help or suggestion will be appreciated


texts:
I need add block div into tag a like on image, it is desirable programmatically.

Any help would be greatly appreciated


texts: Magento 2.1.8 - Menu not showing on CMS pages

texts:
I created a new Magento store 2.1.8 without sample data. When I added a category under the root category - it will not show on the home page. When I log in as a customer, on customer_account_index, I can see the menu.

When I go to the home page, I do not see any grey navigation area like on customer_account_index

It seems like on none of the CMS pages, I can see the catalog menu. The settings in

Catalog -> Category Top Navigation -> Depth is set to 10.

Some extra information, it’s the Bitnami configuration.


texts: Magento 2 Staging url gets redirected to production

texts:
I had setup staging environment for my magento 2.3 site.
The setup is same like production.
When i click on anything on staging site, it gets redirected to production.
Checked everything(base url , config data) everything is correct.
Cleared cache also.
How to solve this issue?


texts:
I want dependency in etc/modules/xml file

How to use dependency in xml

<?xml version="1.0"?>
<config>
    <modules>
        <SM_Example>
            <active>true</active>
            <codePool>local</codePool>
        </SM_Example>
    </modules>
</config>

This module is depend on SM_Rate i mean i m using foreign key of this module table SM_Rate in this SM_Example so when i install this two module than some time it give error SM_Rate this module is not exist bcz of  this module  SM_Example is install first


texts:
I would like to add column to the backend order grid.

I then followed this tutorial : Tuto

on this model, I then tried to add a second column : the client company

I tried :

    <?php
class Mine_Ordergridmodule_Model_Observer
{

public function salesOrderGridCollectionLoadBefore($observer)
    {
        $collection = $observer->getOrderGridCollection();
        $select = $collection->getSelect();
        $select->joinLeft(array('payment'=>$collection->getTable('sales/order_payment')), 'payment.parent_id=main_table.entity_id',array('payment_method'=>'method'));

        //$select->join('sales_flat_order_address', 'main_table.entity_id = sales_flat_order_address.parent_id',array('company_name'=>'company'));
        $select->joinLeft(array('company'=>$collection->getTable('sales_flat_order_address')), 'company.parent_id=main_table.entity_id',array('company_name'=>'company'));

    }

}

and in my layout xml :

<layout>
    <sales_order_grid_update_handle>
        <reference name="sales_order.grid">
            <action method="addColumnAfter">
                <columnId>payment_method</columnId>
                <arguments>
                    Payment Method
                    <index>payment_method</index>
                    <filter_index>payment.method</filter_index>
                    <type>text</type>
                </arguments>
                <after>grand_total</after>
            </action>
            <action method="addColumnAfter">
                <columnId>company</columnId>
                <arguments>
                    Company
                    <index>company</index>
                    <type>text</type>
                </arguments>
                <after>shipping_name</after>
            </action>
        </reference>
    </sales_order_grid_update_handle>
    <adminhtml_sales_order_grid>

        <update handle="sales_order_grid_update_handle" />
    </adminhtml_sales_order_grid>
    <adminhtml_sales_order_index>

        <update handle="sales_order_grid_update_handle" />
    </adminhtml_sales_order_index>
</layout>

but it is not working...


texts: Get core Magento tables value in custom module

texts:
I want to fetch productalert table value in my custom module.

I tried below code.

$databae =  Mage::getModel('productalert/productalert')->load($alert_stock_id, 'alert_stock_id');
Mage::log( $databae );

Warning: include(Mage/ProductAlert/Model/Productalert.php): failed to open stream: No such file or directory in /home/somename/beta.somename.com/lib/Varien/Autoload.php on line 93

UPdate::1
I got the database now

$customer_id = 6;
$customer_stock_alerts = Mage::getModel('productalert/stock')
    ->getCollection()
    ->addFieldToFilter('customer_id', $customer_id);

foreach ( $customer_stock_alerts as $alert ) {
    $customerValue =  $alert->getProductId();
}

I want to send mail to all the user whose status=0 and a spacific product_id

$customer_status = 0;
$customer_stock_alerts = Mage::getModel('productalert/stock')
    ->getCollection()
    ->addFieldToFilter('customer_id', $customer_status)
    ->addFieldToFilter('product_id', $productId);

But it gives me no data


texts: how to conditionally load an external js file in local.xml?

texts:
I'm just getting started with Magento, and am setting up my local.xml file for the first time. I'm trying to load the html5shiv script from google code, on the condition that the browser is older than IE 9. So, I want the header file to include the following code:

<!--[if lt IE 9]>
  <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

I've figure out how to load an external js file. My code is currently:

        <reference name="head">
        <block type="core/text" name="shim">
            <action method="setText"><text><![CDATA[<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>]]></text>
            </action>
        </block>
        </reference>

That works fine to load the external file. But, I'm at a loss as to how to turn this into a conditional comment. I've tried adding the following before the closing action tag:

                <params/>
                <if>IE</if>

But that didn't do anything. Anyone know how to make this a conditional comment?


texts:
Magento 1.9.1.0

Something happened and customers are getting the following Error when clicking on the CHECK-OUT button:

The www.mySITE.com page isn’t working

www.mySITE.com is currently unable to handle this request.
500

I suspect this has to do with some kind of an upgrade I bet my hosting provider (HostForWeb) did.

What are the correct versions (requirements) of pHp, mySQL and Apache for Magento 1.9.1.0?

Any other ideas as to what might be causing this?


texts: Programmatically rename product images--existing images already uploaded--for SEO

texts:
I would like to create a simple script to programmatically rename existing, already uploaded product images (without having to re-upload them or use the admin backend).

To process this in manageable chunks, I'm thinking something along the lines of:

specify a category ID, get product collection
foreach product, get all product images
foreach image, rename file on server, update database table(s), following naming convention:

$new_img_name = 'company-name-' . strtolower(preg_replace("/\W+/m", "-", $_product->getName())) . '-' . $product_image_number_incremental;

Steps 1 and 2 above I can do, but I'm not having any luck changing the actual file name on the server and in the database—I can only seem to find programmatic ways to change things like image label.

Thoughts?

--

Details:

Magento CE 1.9.1.1
approx. 900 products
approx. 10 images per product

Reasoning:

I'd like our product images to follow a more SEO-friendly naming convention that includes our company name, the product name, and style information—preferably without all the manual labor of downloading, renaming, and re-uploading all product images (there are a lot...)


texts: Magento 2 What is the use of 'apply_to' to add product attribute?

texts:
I have seen one option 'apply_to' while adding an product attribute.

ex.

$eavSetup->addAttribute(
        \Magento\Catalog\Model\Product::ENTITY,
        'sample_attribute',
        [
            'type' => 'text',
            'backend' => '',
            'frontend' => '',
            'label' => 'Sample Atrribute',
            'input' => 'text',
            'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
            'visible' => true,
            'required' => true,
            'user_defined' => false,
            'default' => '',
            'searchable' => false,
            'filterable' => false,
            'comparable' => false,
            'visible_on_front' => false,
            'used_in_product_listing' => true,
            'unique' => false,
            **'apply_to' => ''**
        ]
    );

Can anyone explain what is the use of 'apply_to' option?
Thanks in Advance.


texts: How to change the order of CSS files. Load module's CSS before theme's CSS in magento2?

texts:
I want to load all extension's css before custom theme css in <head> tag.
Right now extension's css file are loading after styles-m.css and styles-l.css
so I can not override the extension css from my custom theme css.


texts: New product type based on bundle - price type not saving

texts:
I've created new product type extended from bundle product.
Every thing works fine, except "price_type" "sku_type" attributes.
I want to save the price_type as fixed "it's value is 1", also for the sku_type.
But it's not saving this value, In other words those attributes not saving at all, not fixed nor dynamic.
Where should I look for the solution?
I've debuged the data sent by observer before_save and the values sent successfully, but it's not saved to the database.


texts:
Using Magento 2.3.1 EE, 50k products and 14 store views. The catalog_product_price reindex gets stuck with this query listed in SHOW FULL PROCESSLIST

 DELETE `price_index`  FROM `catalog_product_index_price_temp` AS `price_index`
 INNER JOIN `catalog_product_entity` AS `product_entity` ON product_entity.entity_id = price_index.entity_id AND (product_entity.created_in <= '1553317143' AND product_entity.updated_in > '1553317143')
 LEFT JOIN `inventory_stock_1` AS `inventory_stock` ON inventory_stock.sku = product_entity.sku WHERE (inventory_stock.is_salable = 0 OR inventory_stock.is_salable IS NULL) AND (price_index.website_id = 2) AND (price_index.entity_id IN ('129058', '129059', '129060', '129061', '129062', '129063', .....))

The catalog_product_index_price_temp table seems to be temporary. max_heap_table_size and tmp_table_size are both 16777216.

That price_index.entity_id IN has thousands of IDs and the query state stays at "Sending data" for hours. Does somebody have any idea what could be wrong?


texts:
When a customer has an order canceled due to their credit card being declined it seems all extensions redirect customers back to the cart page and not the actual payment page in the checkout.

Is this because the message manager cannot display messages to the customer? Or is that a way of redirect the customer back to /checkout/#payment and display the relevant error messages?


texts: Huge input lookup on admin orders grid page in magento2

texts:
Warning: DOMDocumentFragment::appendXML(): Entity: line 1: parser error : internal error: Huge input lookup in /vendor/magento/framework/View/TemplateEngine/Xhtml/Template.php on line 60

I tried below code but it's not working. can anyone please help me.

public function __construct(
        \Psr\Log\LoggerInterface $logger,
        $content
    ) {

        $this->logger = $logger;
        $document = new \DOMDocument(static::XML_VERSION, static::XML_ENCODING);
        $document->loadXML($content, LIBXML_PARSEHUGE);
        $this->templateNode = $document->documentElement;

    }
public function append($content)
    {
        $target=$this->templateNode->ownerDocument;
        $source = new \DOMDocument();
        $source->loadXml($content, LIBXML_PARSEHUGE);
        $this->templateNode->appendChild(
            $target->importNode($source->documentElement, TRUE)
        );
    }


texts:
I have a script that adds items to a cart from an external source. The cart is created and products added and now I want to return a URL to the cart.

This URL should open the checkout cart and display the cart contents.

Here is the script so far but it opens to an empty cart

<?php

include '../app/Mage.php';
Mage::app();

$cartId = $_GET['id'];

$quote = Mage::getModel('sales/quote')->load($cartId);

$quote->setIsActive(true)->save();

$Url= Mage::getUrl('checkout/cart');

echo $Url;

?>


texts: Magento Multi-Store - Seperate IP for each Admin?

texts:
Is it possible to have a multi-store setup, in which the admin area for each store utilizes a separate IP address for each domain?

For example:

Dedicated Server - 1 Magento Install

Domain1.com/admin = 1.1.1.1
Domain2.com/admin = 2.2.2.2

The reason is to use an extension such as M2E to push products to Ebay, etc. - but would like each store's "push" to come from a seperate IP address.  (e.g., onc domain cannot be traced back to the other).  It's a requirement that nobody can know the 2 domains are the same company.

Would it be easier to create 2 separate Magento installs? If so, how could we synchronize the inventory from one to the other?


texts: In footer.phtml file php code is not working properly

texts:
Strange in magento footer.phtml file. I am adding a below code in footer area to place text according to current page, whether its cms page or any other page but it is not working correctly.

if(Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms')
{
  echo "CMS page";
}
else{
    echo "Not a CMS page";
}

But its not working, while this code is working fine in header.phtml file provide the correct result according to page.

If I click "Flush Magento Cache" button from "Cache Storage Management" section in back-end it will work for fist time but when I change page to product or vice versa its will not works, it provide the same result all time.

Also header.phtml file code work correctly all time.

Please can anyone suggest me on this?