texts: Layout - Pass variables from parent to child

texts:
How can I access variables defined in the parent template inside a child template?

Example -> I added a new block with name product.info.grouped.news_flag as child of the block with name product.info.grouped in the catalog.xml layout of my design:

<PRODUCT_TYPE_grouped translate="label" module="catalog">
    Catalog Product View (Grouped)
    <reference name="product.info">
        <block type="catalog/product_view_type_grouped" name="product.info.grouped" as="product_type_data" template="catalog/product/view/type/grouped.phtml">
            <block type="core/text_list" name="product.info.grouped.extra" as="product_type_data_extra" translate="label">
                Product Extra Info
            </block>

            <block type="core/template"
                   name="product.info.grouped.news_flag"
                   as="product_type_data_news_flag"
                   template="catalog/product/view/type/news_flag.phtml"/>

        </block>
    </reference>
</PRODUCT_TYPE_grouped>

This is the part in the template file of the parent block where I call my new block with name product.info.grouped.news_flag:

catalog/product/view/type/grouped.phtml

<?php
    $testVar = 123;
    echo $this->getChildHtml('product_type_data_news_flag');
?>

As you can see I created a variable named $testVar with value 123.

But If I try to call the value in the child block product_type_data_news_flag then I get null:

catalog/product/view/type/news_flag.phtml

<?php
    $a = $testVar;
    echo $a; // returns null

How can I pass a variable from the parent block/template to the child block/template?


texts: Admin check if an admin user has administrator privileges - programmatically

texts: I am trying to find a provision for checking out the privileges of current logged in user, I am able to get the data of current logged admin from session, but struggling to get the privileges it has, any suggestions?


texts: create category and sub category programmatically in magento2

texts:
I need to create more then 50+ category. I Tried manually it take a too much of time so how to create category programatically?

<?php
use Magento\Framework\App\Bootstrap;
require __DIR__ . '/app/bootstrap.php';
$bootstrap = Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();
$state = $objectManager->get('Magento\Framework\App\State');
$state->setAreaCode('frontend');

function readCSV($csvFile){
 $file_handle = fopen($csvFile, 'r');
 while (!feof($file_handle) ) {
  $line_of_text[] = fgetcsv($file_handle, 1024);
 }
 fclose($file_handle);
 return $line_of_text;
}
// Set path to CSV file
$csvFile = 'csv/categories.csv';
$arrResult = readCSV($csvFile);
echo '<pre>';
print_r($arrResult);
echo '</pre>';

importCategories( $arrResult, $objectManager, $storeId );

/**
 * Import categories to Magento
 *
 * @param $arrResult
 */
function importCategories( $arrResults, $objectManager, $storeId )
{
    $parentId = '2';
    $list = array();
    foreach ( $arrResults as $import_category ) {
        try {
            $enabled = ( strtolower( $import_category[5] ) == 'true' ) ? 1 : 0;
            $parentId = ( $import_category[1] == 0 )? '2' : $list[$import_category[1]];
            $url = strtolower($import_category[2]);
            $cleanurl = trim(preg_replace('/ +/', '', preg_replace('/[^A-Za-z0-9 ]/', '', urldecode(html_entity_decode(strip_tags($url))))));
            $categoryFactory = $objectManager->get('\Magento\Catalog\Model\CategoryFactory');
            /// Add a new sub category under root category

            $category = $categoryFactory->create();
            $category->setName(ucfirst($import_category[2]));
            $category->setIsActive( $enabled );
            $category->setUrlKey($cleanurl);
            $category->setData('description', strip_tags($import_category[10]));
            $category->setParentId($parentId);

            //$mediaAttribute = array ('image', 'small_image', 'thumbnail');
            //$category->setImage( $import_category[6], $mediaAttribute, true, false);// Path pub/meida/catalog/category/
            $category->setStoreId($storeId);
            $rootCat = $objectManager->get('Magento\Catalog\Model\Category')->load($parentId);
            $category->setPath($rootCat->getPath());echo"hi";
            $category->save();echo"hi";
            $list[$import_category[0]] = $category->getId();
            echo 'Category ' . $category->getName() . ' ' . $category->getId() . ' imported successfully' . PHP_EOL;
        }
        catch (Exception $e)
        {
            echo 'Something failed for category ' . $import_category[2] . PHP_EOL;
            print_r($e);
        }
    }
    return $list;

}


texts: Why I am getting blank page on magento 2 orders print.?

texts: In my account pages when I click on print order I am getting a blank page with just order number and URL. What is the issue? Magento version is 2.1.8


texts: what is the savedsearch rest api url for netsuite?

texts:
I would like to access Netsuite savedSearch rest API url to import data in Magento 2.
Here is example of rest api to access items from netsuite
https://xxxxxxxxx.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryItem

Anybody knows url of Netsuite savedsearch Rest API ?
I want just netsuite savedsearch rest api url.


texts: CMS blocks does not works on Products using Custom Layout Update field in Categories

texts:
I would like to apply a CMS Block only for products in a specific Category. And I wish to shows it up only at Black Friday's week.

My luck is that I can set the Custom Layout Update field in my Category's admin page. And setting "Apply to All Products" to Yes should works as I'm expecting.

Well I've created my Cms block, but cant show my block in product page.
Next the layout code used in "Custom Layout Update" field, on parent Category:

<layout>
    <catalog_product_view>
        <reference name="product.info">
            <block type="cms/block" name="friday.price" before="-">
                <action method="setBlockId"><block_id>friday_banner</block_id></action>
            </block>
        </reference>
    </catalog_product_view>
</layout>

All things works very well when I set another block (not custom cms).
Anyone know what is happening?


texts: Zend http client exception: Unable to read response

texts:
I have an issue with a Magento 2.2.4 store, sometimes when customer tries to pay by Creditcard Authorize.net CIM module,when he clicks to order button the page reloads and the cart empties
without any error message, in log i have this error
main.CRITICAL: Unable to read response, or response is empty {"exception":"[object] (Zend_Http_Client_Exception(code: 0): Unable to read response, or response is empty at /vendor/magento/zendframework1/library/Zend/Http/Client.php:1094)


texts: Create order programmatically in magento

texts:
I am using the below code to create orders, But getting exception as "Please specify a shipping method." Also the payment method, The code says invalid. Please let me know where i can check these shipping and payment methods. Kindly explain in detail. Beginner in magento

<?php
include 'connect.php';
$db=mysqli_select_db($conn,'onceaga9_aw');
$mageFilename = 'app/Mage.php';
require_once $mageFilename;
Mage::setIsDeveloperMode(true);
umask(0);
Mage::app();

extract($_POST);
$productids = array(983);
$websiteId = Mage::app()->getWebsite()->getId();
$store = Mage::app()->getStore();
// Start New Sales Order Quote
$quote = Mage::getModel('sales/quote')->setStoreId($store->getId());

// Set Sales Order Quote Currency
$quote->setCurrency($order->AdjustmentAmount->currencyID);
$customer = Mage::getModel('customer/customer')
    ->setWebsiteId($websiteId)
    ->loadByEmail($email);
if ($customer->getId() == "") {
$customer = Mage::getModel('customer/customer');
$customer->setWebsiteId($websiteId)
        ->setStore($store)
        ->setFirstname('Jhon')
        ->setLastname('Deo')
        ->setEmail($email)
        ->setPassword("password");
$customer->save();
}

// Assign Customer To Sales Order Quote
$quote->assignCustomer($customer);

// Configure Notification
$quote->setSendCconfirmation(1);
foreach ($productids as $id)
{
$product = Mage::getModel('catalog/product')->load($id);
$quote->addProduct($product, new Varien_Object(array('qty' => 1)));
}

// Set Sales Order Billing Address
$billingAddress = $quote->getBillingAddress()->addData(array(
'customer_address_id' => '',
'prefix' => '',
'firstname' => 'john',
'middlename' => '',
'lastname' => 'Deo',
'suffix' => '',
'company' => '',
'street' => array(
    '0' => 'Noida',
    '1' => 'Sector 64'
),
'city' => 'Noida',
'country_id' => 'IN',
'region' => 'UP',
'postcode' => '201301',
'telephone' => '78676789',
'fax' => 'gghlhu',
'vat_id' => '',
'save_in_address_book' => 1
    ));

// Set Sales Order Shipping Address
$shippingAddress = $quote->getShippingAddress()->addData(array(
'customer_address_id' => '',
'prefix' => '',
'firstname' => 'john',
'middlename' => '',
'lastname' => 'Deo',
'suffix' => '',
'company' => '',
'street' => array(
    '0' => 'Noida',
    '1' => 'Sector 64'
),
'city' => 'Noida',
'country_id' => 'IN',
'region' => 'UP',
'postcode' => '201301',
'telephone' => '78676789',
'fax' => 'gghlhu',
'vat_id' => '',
'save_in_address_book' => 1
    ));
if ($shipprice == 0) {
$shipmethod = 'freeshipping_freeshipping';
}

// Collect Rates and Set Shipping & Payment Method
$shippingAddress->setCollectShippingRates(true)
    ->collectShippingRates()
    ->setShippingMethod('flatrate_flatrate')
    ->setPaymentMethod('checkmo');

// Set Sales Order Payment
//$quote->getPayment()->importData(array('method' => 'checkmo'));
$quote->setShippingMethod('flatrate_flatrate');

// Collect Totals & Save Quote
$quote->collectTotals()->save();

try {
// Create Order From Quote
$service = Mage::getModel('sales/service_quote', $quote);
$service->submitAll();
$increment_id = $service->getOrder()->getRealOrderId();
}
catch (Exception $ex) {
echo $ex->getMessage();
}
catch (Mage_Core_Exception $e) {
echo $e->getMessage();
}

// Resource Clean-Up
$quote = $customer = $service = null;

// Finished
return $increment_id;
?>


texts: magento 2: admin login form inputs cut in half

texts:
I first noticed this bug on chrome canary and now occurs with the latest update to chrome beta.  I have logged it as a bug to chrome, but wanted to get some additional input if this bug is indeed chrome related or is actually magento.

Chrome Version: 55.0.2883.28 beta (64-bit) on Windows 10

If I remove the float on .admin__legend, form changes to this

It seems that the legend tag's width is unable to be changed, which may be causing the issue and the additional white space inside the legend tag.

Here is what I have tried

Ultimately I could solve this with position: absolute; but I feel like that is cheating.

Let me know if you think this is a chrome related issue or something magento needs to prepare to fix.  Also I'd be interested if anyone can come up with a simple fix.


texts: Select sub-categories of a specific category of a product in Magento 1.9

texts:
I am trying to write code for generating Google shopping feed in Magento 1.

I want to get categories assigned to a product which are subcategories of a specific category (Designers).

How do I do this?

I want to populate this in the brand tag in the XML and we do not have any manufacturers but store them in categories with a parent category called 'Designers'


texts: Magento 2 wamp admin page doesn't load/display

texts:
I'm trying out Magento 2 using localhost with wamp and I can't get the admin page to load/display?
I do get a page with index.php but it doesn't display the luma logo as in examples I've seen, so unsure if this is correct?
Below - first image is the admin page which is just a dark grey blank page - second image is the index page


texts: How to enable checkbox by default checked in Custom Option?

texts: I am using magento 1.9.3.6 version. I have created custom option for product. I want to make checkbox by default checked. How can I implement this?


texts: Customer Can Buy a Product Once and Can be Purchased alone

texts:
In Magento, I have some products, which can be purchased only once by a customer, and this products can be purchased alone not combined with any products.

Eg.
1) If the Product X purchased by a customer C, then when the customer C again try to purchase the product X , it should not allow him to purchase.

2) The Product X, can be purchased alone only, when the customer add the Product X to cart, then it needs to check whether already any products are in cart,

if no, then this product can add to cart
if yes, then this product should not add to the cart, need to show
some notification and need to redirect to product page.

any ideas?

thanks in advance.


texts: Error message in system.log regarding Undefined variable: block in Filter.php

texts:
Error message is in system.log file. Looked at lines 187 and 197 of app/code/core/Mage/Core/Model/Email/Template/Filter.php and can't figure out what could be wrong?
Error as displayed in system.log:

2015-12-29T17:11:22+00:00 ERR (3): Notice: Undefined variable: block  in /home/public_html/SITE/app/code/core/Mage/Core/Model/Email/Template/Filter.php on line 187
2015-12-29T17:11:22+00:00 ERR (3): Notice: Undefined variable: block  in /home/public_html/SITE/app/code/core/Mage/Core/Model/Email/Template/Filter.php on line 197

Filter.php file content at line 187 and 197:


texts: Search through adminhtml grid not working 1.9

texts:
Magento ver. 1.9.2.4 Search through admin grids suddenly stopped working.
No js files with 404 status, no errors in js console.
Script productGridJsObject = new varienGrid(... is present, as it should.

Only error is when anu button is clicked:

(index):522 Uncaught ReferenceError: productGridJsObject is not defined
    at HTMLButtonElement.onclick ((index):522)

I thought it was defined, really.

How to debug it?


texts:
I installed paid template ethan on Magento 2.1.1 and imported a ready full demo database.

Unfortunately, when I imported full demo the database, the page stopped displaying correctly. also administrative panel is working correctly

Only the main banner is displayed. in the attachment a screenshot of the entire page.

Here is error code:

Fatal error: Uncaught Error: Call to a member function unserialize() on null in F:\XAMPP\htdocs\magento\vendor\magento\module-swatches\Helper\Data.php:174 Stack trace: #0 F:\XAMPP\htdocs\magento\vendor\magento\module-swatches\Helper\Data.php(530): Magento\Swatches\Helper\Data->populateAdditionalDataEavAttribute(Object(Magento\Catalog\Model\ResourceModel\Eav\Attribute\Interceptor)) #1 F:\XAMPP\htdocs\magento\vendor\magento\module-swatches\Model\Plugin\Configurable.php(62): Magento\Swatches\Helper\Data->isVisualSwatch(Object(Magento\Catalog\Model\ResourceModel\Eav\Attribute\Interceptor)) #2 F:\XAMPP\htdocs\magento\vendor\magento\framework\Interception\Interceptor.php(152): Magento\Swatches\Model\Plugin\Configurable->afterGetUsedProductCollection(Object(Magento\ConfigurableProduct\Model\Product\Type\Configurable\Interceptor), Object(Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Product\Collection\Interceptor)) #3 F:\XAMPP\htdocs\magento\var\generation\Magento\ConfigurableProduct\Model\Product\Type in F:\XAMPP\htdocs\magento\vendor\magento\module-swatches\Helper\Data.php on line 174


texts:
When I open the page in Private Browsing / Quote no initialize at that time it show the empty value in minicart count, but it should show 0.

If I add product(s) in cart then I can see the number of items in cart. After that I remove all products from the cart then also I can see the 0 in Cart count.

initial page load I cant see the Item counts in minicart. I have used below code,


texts: Get Base Url Or Dynamic Url In view Js or html files

texts:
I figure it out to get dynamic url in the front end if I need I can simply define mage/url and the use it as url.build('<Modulename>/<controllername>/<action>/')

When I tried the same thing for the backend it didn't return me the expected result.

It gave the the current url and append the path which I had given.

Can anyone explain how this works out. Do I need to define the baseUrl somewhere ?


texts: How to get data-mage-init config in our custom magento jquery widget?

texts:
I am currently creating custom jquery widget for owl-carousel just to learn how to do it properly in magento-2.

I have configured my own module in requirejs-config.js at theme level.

var config = {
    map: {
        '*': {
            'carousel': 'js/carousel',
            'owlcarousel': 'js/owlcarousel/owl.carousel',
        }
    },
    shim: {
        'owlcarousel': {
            deps: ['jquery']
        },
        'carousel': {
            deps: ['jquery','owlcarousel']
        }
    }
};

and then inside carousel.js I am setting like below

define([
    'jquery',
    'owlcarousel'
], function($) {
    'use strict';
    $.widget('custom.slider',{

        _create: function(config,element) {
            $(this.element).owlCarousel(config);
        }
    });

    return $.custom.slider;
});

and finally call inside .phtml template with below code.

<div class="custom-element" data-mage-init='{"carousel":{"items": 11}}'>
</div>

Still I am not seeing owl-carousel being loaded with my config that I am passing into data-mage-init.

Please tell what I am doing wrong?

EDIT-

If I write like this, it doesn't work.

_create: function(config,element) {
  this.element.owlCarousel(config);
}

But with this it does.

_create: function(config,element) {
    this.element.owlCarousel(this.options);
}


texts: Change the setting of Reviews to not need approval from BE

texts: What is the best way to disable reviews moderation?


texts:
I have an XML form on the backend. It has the save button the code for which is this -

class SaveButton implements \Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface {

public function __construct(
    \Magento\Backend\Block\Widget\Context $context,
    \Magento\Framework\UrlInterface $urlInterface,
    \Magento\Framework\App\RequestInterface $request
) {
    $this->urlBuilder = $context->getUrlBuilder();
    $this->urlInterface = $urlInterface;
    $this->request = $request;
}

public function getButtonData()
{

    $productId = $this->request->getParam('id');

    return [
        'label' => __('Save'),
        'class' => 'save primary',
         'data_attribute' => [
             'mage-init' => ['button' => ['event' => 'save']],
             'form-role' => 'save',
         ],
        'onclick' => $this->urlBuilder->getUrl( '{moduleName}/{controllerName}/save','product_id' => $productId ] ),
        'sort_order' => 90,
    ];
}

When I click on save, it just reloads the page and doesn't take the control to the save controller.

Thanks!


texts: Magento 2 - Invalid template error after adding custom shipping method and running setup:upgrade

texts:
I have added a custom shipping method module to the app/code folder and after running setup:upgrade I am getting the following error message on the home page:

Error filtering template: Invalid template file: 'product/widget/content/grid_v16.phtml' in module: 'WeltPixel_OwlCarouselSlider' block's name: 'slider\products_0'

I have also run the cache:flush and cache:clean commands.

Edit: Just to clarify, the Carousel Slider widget that is giving the error has nothing to do with my module that was uploaded. The rest of the site is functioning normally.

Any ideas?

Magento version is 2.2.4


texts:
I'm creating a custom module which displays Google Maps in the frontend of Magento. To get those maps the Admin would have to enter and save the URL of the map location in the Admin Panel. This all works fine. The URL is being saved in the database and the maps are displayed in the frontend of the store.

But now I would like to display a preview of this map in the Admin Panel too. This will allow the Admin to easily check whether the correct URL is entered and saved.

I want to display this Preview Map in a new <field> (just below the field where the URL should be entered) and use a Map Preview . The mockup below displays what I am trying to achieve.

To my modules system.xml file I have added the following code:

<fields>
    ....
    <preview translate="label comment">
        Map Preview
        <frontend_type>link</frontend_type>
        <frontend_model>mymodule/system_config_map</frontend_model>
        <comment>Preview of your map</comment>
        <sort_order>20</sort_order>
        <show_in_default>1</show_in_default>
        <show_in_website>1</show_in_website>
        <show_in_store>1</show_in_store>
    </preview>
</fields>

And my MyNamespace/MyModule/Block/System/Config/Map.php contains the following code:

class MyNamespace_MyModule_Block_System_Config_Map extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface
{
    public function render(Varien_Data_Form_Element_Abstract $element) {

    $url = Mage::helper('mymodule')->getMapUrl($store = null);

    return '';
    }
}

This does render the Google Map in the Admin Panel and it also renders in the proper <group> but it is not loaded in the <field> that I want. This is an actual screen shot of the current situation.

I have tried every <frontend_type> I can think of....

So my question is: How can I insert an  in an Admin Panel <field>? Should I add something to my <frontend_model>?


texts: Prices displayed don't match prices in admin

texts:
I'm using Magento CE 1.9.0.1. I have a series of products that are entered into the admin (inclusive of tax) and the system configuration is also set so that prices entered include tax.

However, on the frontend the configurable and simple products are showing either 1p above or below what they should be.

I don't understand why Magento is changing the price - in theory it should be just showing exactly as it is in the admin as there is no tax calculation to perform.

I wondered if anyone else has experienced this issue?


texts: Magento 2: How to fix error `[Zend_Db_Adapter_Exception] SQLSTATE[HY000] [2002]

texts: I install lampp on linux. Then install Magento 2. However, i get some errors when run any command.


texts: How to use ajax in alert modal magento 2?

texts:
I have this ajax code and i want to use alert modal of magento 2.

<script>
    require(['jquery'],function($){
        $(document).ready(function() {
            $("#vendor_search").on('click',function(){
                event.preventDefault();
                var input = $("#customer_id").val();
                var param = { data : input};
                var url = '<?php  echo $block->getUrl('kyanh/vendor/getinfo');?>';
                $.ajax({
                    url: url,
                    type: "POST",
                    data: param,
                    dataType: 'json',
                    cache: false,
                    showLoader: true
                }).done(function(data)
                {
                    var ar = [
                        data['cus_id'],
                        data['lname'],
                        data['email']
                    ];
                    alert(ar);
                });
            });
        });
    });
</script>

Pls help me, tks for reading!


texts: How to prevent price.phtml to be cached (updated prices do not show on category listing; well on product page)

texts:
When adjusting the prices for products, as well as the special prices, I have to refresh the block html cache since it turns invalidated, plus the fact that I have to reindex in order to see the updated prices in the category listing page.

The calling to these processes is stored in price.phtml, so I was wondering if there is a possibility for not allowing that content to be cached. The updated prices show well in the product pages, but not in the category page.


texts:
In my custom module i am trying to upload images. I am able to upload images with the help of this link

  https://webkul.com/blog/how-to-upload-image-in-magento2/

But is there any way where we can preview the image before uploading to server in M2. Like

  isAjax = true

Do we have any possibility in M2 to make functionality  same like

  catalog/product_gallery/upload


texts: Magento 2: Above the fold CSS - inline CSS to

texts:
(Magento 2.1.4) I am trying to add my 'above the fold' CSS in to the <head> section.

I know I can add it in via Content > Configuration > HTML Head however the issue with this is that it loads it AFTER the merged/minified deployed CSS files.

I've tried just putting <style>CSS</style> in to my default_head_block.xml but that doesn't work. And as far as I can tell you can't put a block in to this XML (I might be wrong though)

What is the best method?

Thanks


texts: How to suspend one store until January 8th with least SEO damage?

texts:
Magento 1.9.1
Porto theme
Amasty's delivery date extension (plugin)

We have few different stores running off the same Magento 1.9.1 installation. We have the Delivery date extension (a calendar) installed because we hand deliver the product. I have disabled all the days in the calendar until January 8th but a few orders just keep coming through...I cannot duplicate the issue because when I try to place an order without a date - it doesn't let me and when I open the calendar - all the days until January 8th are grayed out (not available). I'm not really sure how these customers are able to place orders?

Any which way - what is the best way to  make it so people would not be able to order WITHOUT completely destroying our SEO standing?


texts: $this->_checkoutSession->getQuote()->getAllItems() returning an empty array

texts:
I am trying to get a collection of all items in the cart for current session but the array is returning [0].

My block:

<?php
namespace GGG\PaymentMethodsManagment\Block;
class GetProductsInCart extends \Magento\Framework\View\Element\Template
{
    protected $_cart;
    protected $_checkoutSession;

    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        \Magento\Checkout\Model\Cart $cart,
        \Magento\Checkout\Model\Session $checkoutSession,
        array $data = []
    )
    {
        $this->_cart = $cart;
        $this->_checkoutSession = $checkoutSession;

        parent::__construct($context, $data);
    }

    public function getCart()
    {
        return $this->_cart;
    }

    public function getCheckoutSession()
    {
        return $this->_checkoutSession;
    }

}

In my template file:

<?php
    $quote = $block->getCheckoutSession()->getQuote();
    $items = $quote->getAllItems();
    var_dump($items);
?>

var_dump($items) is printing array(0) { }.

Can anyone help?

UPDATE:

All suggestions from the current answer:

<?php
    $quote = $block->getCheckoutSession()->getQuote();
    \Zend_Debug::dump($quote);
    $getItemsCollection = $quote->getItemsCollection();
    $itemCountgetItemsCollection = count( $getItemsCollection );
    echo "getItemsCollection():";
    \Zend_Debug::dump($itemCountgetItemsCollection);

    $getItems = $quote->getItems();
    $itemCountgetItems = count( $getItems );
    echo "getItems():";
    \Zend_Debug::dump($itemCountgetItems);

    $getAllItems = $quote->getItems();
    $itemgetAllItems = count( $getAllItems );
    echo "getAllItems():";
    \Zend_Debug::dump($itemgetAllItems);

    $getAllVisibleItems = $quote->getAllVisibleItems();
    $itemCountgetAllVisibleItems = count( $getAllVisibleItems );
    echo "getAllVisibleItems():";
    \Zend_Debug::dump($itemCountgetAllVisibleItems);

?>

All of the  abode return int(0):


texts: Magento 2 Redirect user to a custom payment method from a custom page?

texts:
i am trying to redirect a user to a custom offline payment method that i have created form one of my phtml file using a button click.

my payment method name is pay by cash.

I have a template where i am listing all the orders.

I want to redirect user to the Pay by Cash payment method and automatically do a place order by Pay by cash method on button click.

please help ! how i can do that.


texts:
I want to add few custom attribute to General Information in Magento > Catalog > Manage Category

But this not going to work. Please help me to find out here are my code below.

modules/Wri_CustomCategoryAttribute.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Wri_CustomCategoryAttribute>
            <active>true</active>
            <codePool>community</codePool>
        </Wri_CustomCategoryAttribute>
    </modules>
</config>

community/Wri/CustomCategoryAttribute/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Wri_CustomCategoryAttribute>
            <version>0.0.1</version>
        </Wri_CustomCategoryAttribute>
    </modules>

    <global>
        <resources>
            <add_category_attribute>
                <setup>
                    <module>Wri_CustomCategoryAttribute</module>
                    <class>Mage_Catalog_Model_Resource_Setup</class>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </add_category_attribute>
            <add_category_attribute_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </add_category_attribute_write>
            <add_category_attribute_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </add_category_attribute_read>
        </resources>
    </global>
</config>

community/Wri/CustomCategoryAttribute/sql/add_category_attribute/mysql4-install-0.0.1.php

<?php
$this->startSetup();
$this->addAttribute(Mage_Catalog_Model_Category::ENTITY, 'h2_text', array(
    'group'         => 'General Information',
    'input'         => 'textarea',
    'type'          => 'text',
    'label'         => 'H2 Text',
    'backend'       => '',
    'visible'       => true,
    'required'      => false,
    'visible_on_front' => true,
    'global'        => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
));

$this->addAttribute(Mage_Catalog_Model_Category::ENTITY, 'view_more_text', array(
    'group'         => 'General Information',
    'input'         => 'textarea',
    'type'          => 'text',
    'label'         => 'View More Text',
    'backend'       => '',
    'visible'       => true,
    'required'      => false,
    'visible_on_front' => true,
    'global'        => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
));

$this->addAttribute(Mage_Catalog_Model_Category::ENTITY, 'view_more_link', array(
    'group'         => 'General Information',
    'input'         => 'textarea',
    'type'          => 'text',
    'label'         => 'View More Links',
    'backend'       => '',
    'visible'       => true,
    'required'      => false,
    'visible_on_front' => true,
    'global'        => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
));

$this->endSetup();

I am following instructions from here


texts: Magento 2: I want to upload file in magento 2 from front-end

texts:
$uploaderFactory = $this->uploaderFactory->create(['fileId' => 'image']);

I want to know 'fileId' and 'image' what is this one mean?


texts:
How to remove URL/___from_store=xx?... it's showing url like ?___from_store=en

Please help!

I am using Magento 2.2.3. I added this code in /magento/module-store/model/Store.php but it's not working:

/**
 * To clean URL from wrong query string
 *
 * @return Cleaned url
 */
public function cleanUrlQueryString($url)
{
    if(preg_match("/\?/", $url)){
        $arr = explode('?', $url);
        $queryArray = false;
        if(isset($arr[1])){
            $strArr = parse_str(html_entity_decode($arr[1]), $queryArray);
        }
        $cleanedUrl = $arr[0];
        $cleanedUrl .= ($queryArray) ? '?'.http_build_query($queryArray, '', '&amp;') : '';
        return $cleanedUrl;
    }
    return $url;
}


texts: Overwrite Constructor to inject custom module helper

texts:
I have created a custom module. which rewrites \Magento\Checkout\Block\Onepage\Success class by creating a custom module.

and i am able to make changes in prepareBlockData function but i want to inject helper class of my custom module in success block constructor below is the code i tried.

<?php

namespace Test\Buynow\Block\Magento\Checkout\Onepage;

use Magento\Customer\Model\Context;
use Magento\Sales\Model\Order;

class Success extends \Magento\Checkout\Block\Onepage\Success
{

    protected $_checkoutSession;

    protected $_orderConfig;

    protected $httpContext;

    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magento\Checkout\Model\Session $checkoutSession,
        \Magento\Sales\Model\Order\Config $orderConfig,
        \Magento\Framework\App\Http\Context $httpContext,
        \Test\Buynow\Helper\Buynow $buynowHelper, //custom module helper class which i want to inject
        array $data = []
    ) {
        parent::__construct($context, $data);
        $this->_checkoutSession = $checkoutSession;
        $this->_orderConfig = $orderConfig;
        $this->_isScopePrivate = true;
        $this->httpContext = $httpContext;
        $this->buynow = $buynowHelper; //custom module helper class which i want to inject
    }

    protected function prepareBlockData()
    {
        $order = $this->_checkoutSession->getLastRealOrder();
        $isReference= false;

        if($order->getReference()):
            $isReference = true;
        endif;

        $this->addData(
            [
                'is_order_visible' => $this->isVisible($order),
                'view_order_url' => $this->getUrl(
                    'sales/order/view/',
                    ['order_id' => $order->getEntityId()]
                ),
                'print_url' => $this->getUrl(
                    'sales/order/print',
                    ['order_id' => $order->getEntityId()]
                ),
                'can_print_order' => $this->isVisible($order),
                'can_view_order'  => $this->canViewOrder($order),
                'order_id'  => $order->getIncrementId(),
                'reference'=> $isReference
            ]
        );
    }
}

after doing this i have flushed cache and deployed static content but i am getting below error.

  PHP Fatal error: Uncaught TypeError: Argument 2 passed to
  Magento\Checkout\Block\Onepage\Success::__construct() must be an
  instance of Magento\Checkout\Model\Session,


texts: Omitting schedule in module's crontab config xml

texts:
I see this in the Mage_Log config.xml

<crontab>
    <jobs>
        <log_clean>
            <run>
                <model>log/cron::logClean</model>
            </run>
        </log_clean>
    </jobs>
</crontab>

and noticed that the <schedule> tag is omitted. I know this cron job is schedule to run at what is set in the System > Configuration > Advanced > System > Log Cleaning configuration, but I don't see how this connection is made. How does Magento know when to run this cron based on the configuration in admin panel? I'm trying to do something similar for a custom module.

I'm using Magento EE 1.13.0.2.


texts:
I'm trying to inject \Magento\Framework\Filter\FilterManager $filterManager Object to be able to use truncate fucnction in list.phtml

     $this->_filter->truncate($string, ['length' => $length, 'etc' => '...'])

So I overwride \Magento\Catalog\Block\Product\ListProduct. Everything is connected properly. I Overwride this method

  public function getLoadedProductCollection(){
           var_dump('working');
 }

It's properly returning the string 'Working'. Now the problem comes when I use the __construct and try to inject Magento\Framework\Filter\FilterManager Class within the constructor. So i'm trying to do

    protected $_filterManager;

    public function __construct(
        \Magento\Catalog\Block\Product\Context $context,
        \Magento\Framework\Data\Helper\PostHelper $postDataHelper,
        \Magento\Catalog\Model\Layer\Resolver $layerResolver,
        CategoryRepositoryInterface $categoryRepository,
        \Magento\Framework\Url\Helper\Data $urlHelper,
        \Magento\Framework\Filter\FilterManager $filterManager,
        array $data = []
    ) {
        $this->_catalogLayer = $layerResolver->get();
        $this->_postDataHelper = $postDataHelper;
        $this->categoryRepository = $categoryRepository;
        $this->urlHelper = $urlHelper;
        $this->_filterManager = $filterManager;
        parent::__construct(
            $context,
            $data
        );

I clean cache, but the page fails to load giving this error.

a:4:{i:0;s:37:"Object DOMDocument should be created.";i:1;s:12622:"#0


texts: Reload system config to get last saved values

texts:
When I save new value of a custom option in system config that new value is not available in the same request. For example, somewhere at the beginning of a controller action in a custom module I save the new value:

Mage::getConfig()->saveConfig('some/custom/option1', 'ABC');

And then at the end of that action when I try to get the value of this option from config:

$newValue = Mage::getStoreConfig('some/custom/option1');

it doesn't return ABC but the old value of this option. I understand it gets this old value from cached config.

Question: Is there a way to programmatically refresh/reload the system config to get the real last saved values from system config?


texts:
Which features do you use/suggest to organize sale events on your Magento 2 Commerce stores?

Sale event is a period of time when some temporary changes are needed to be performed on the website. Normally the following points are changed:

prices for some/all categories (using catalog price rules)
banners/CMS blocks
need a way to specify whenever sales is going on right now in the code (to be able to change something in custom webstore specific features)
maybe product images

Looks like Content Staging is something that needs to be used in such cases.

Though does anyone have real experience of using that? I feel like there will can be some bottlenecks with size of database once it is used.


texts: Where is this "{{template config_path="design/email/footer"}}" found? (it is at the end of the Order Confirmation Email template)

texts:
Magento 1.9.1
Porto theme

I go into System --) Transactional Emails

and

I find the new_order Template. I am trying to change the font size (what is the best way to do that anyway? I am currently working with the h1-h5 tags...Is it possible to use the font tag in there also?)

At the bottom of this temple is the following code:

{{template config_path="design/email/footer"}}

I assume this is what throws the "Thank you, storename.com!" message there in really big letters? Where can I change this? (make it smaller font)


texts: How can I export the product image URLs?

texts:
How can I export the product image URLs from Magento 1.9?

I've used the import/export tool in Magento 1.9.
The resulting CSV file contains no product image URLs.


texts: Capture all Authorized Transaction at 12AM - Magento

texts:
I am working on Magento and willing to know if its possible that I set the Authorize.net to only "Authorize" from the admin settings and at 12AM daily capture the payments for all "Authorized" & "Invoiced" transactions for the previous day or same day orders.

Is it possible to do that?


texts: Checkout not working after remove Apple Pay

texts:
Using Magento 2. Another user integrated Apple Pay on both our Magento and payment gateway Braintree

Realized need Apple Pay account as well and don't have one.  So decided to remove Apple Pay from both Magento and Braintree

But now when trying to go to checkout (after entering shipping info), get to Payment Method page but get the "spinner" and nothing happens...just "spinner" keeps going.

I tried flushing cache but still no luck.  I checked chrome "inspect" and see message "Braintree ApplePay Apple Pay is not supported on this device/browser".  NOt sure if this is the issue

Even though Apple Pay has been disabled in Magento, is it still some how being accessed at checkout and need to remove in another place?

Thanks


texts: Nowadays everyone is talking about Magento 2 with Angular JS but I haven't found anything relevant to start with. Can someone please guide me that how and from where I can start the implementation of Magento2 with Angular JS?


texts: Magento 2: Impossible open catalog --> products

texts:
We have about 110k products. Currently during open admin catalog products in backend I get every time timout.
For test I disable timeout in .htaccess
    RewriteRule .* - [E=noabort:1]
RewriteRule .* - [E=noconntimeout:1]

Now I can open catalog products, but this take about 6 minutes. Is very long.
Does anyone have any solution how this can be accelerated?


texts: How can I change the product that was reviewed?

texts: The customer left a review but it is linked to a different product than the item they reviewed. How can I change it to link to the correct product? v1.9.1.0


texts: (CE 1.8) - UPS authentication strange Char Encoding

texts:
After upgrading to Magento 1.8 UPS stop working.

I have checked the UPS log and I can see that XML is wrong:

  <AccessLicenseNumber>øòEñì]a9XXXXX</AccessLicenseNumber>
  <UserId>És.XXXXXX</UserId>

What could be the cause ? it looks it using a wrong Encoding Char


texts: Magento 1.9.0.1 Configurable product options disappear once 1 is in cart

texts:
I have my configurable products set up and they work perfect until one is added to the cart.

As soon as one option is in the cart all of the options disappear and only the "Add to Cart" button is left... this is happening with ALL of the configurable products on my site.

So a customer can only have one of each configurable product instead of various sizes/colors of the same product. I'm hoping this is clear enough, my apologies if it is not.

My site is idahosign.com if anyone would like to take a look. You will have to log in,  I created test login for anyone who would like to view: test@test.com and password: test1234


texts: Magento / CSV import - products aren't visible in shop

texts:
I need to import products from CSV file and I used the option to import products with images form CSV file. The import was done without any problem/errors. I have all products imported in admin panel, but products aren't visible in the shop.

For simple type products I have set up: visibility, availability, categories (all the required fields). Configurable type products also has all the required fields filled up (including is_in_stock). Each product has set is_in_stock 1.

A product shows up in the shop online only when I manually use a sequence: set up product availability to false -> save it -> set up product availability to true -> save again

What can be a reason of this problem? Or maybe anyone know how to do this for all products automatically / directly via database, not manually?

I also tried this method: https://community.magento.com/t5/Magento-1-x-Admin-Configuration/Bulk-update-stock-status/td-p/22130 - without any results.


texts:
Trying to integrate magento 2.0 with a desktop application (i.e the desktop application should be able to create products & download orders) using the REST API.

I am trying to make a 'POST' call to Magento 2.0 token request to get the access token, however, I am getting an error while sending the request:

oauth_problem=Consumer+key+has+expired.

I am trying to generate the signature using:

POST http://xxxxxx/magento/oauth/token/request?oauth_nonce=cyzHawrmnCYz7cJT&oauth_signature_method=HMAC-SHA1&oauth_time

I have been trying to implement rest API.
may be, can I try SOAP if rest API did not work out.  really confusing
which is advisable to use?  REST or SOAP based
I am using bitnami Magento 2.1.6. bitnami is like a library which takes over of wamp,Magento installation as a package. is that okay to use or separation installation is best?

Help needed.


texts: Setting a multiselect attribute using the attribute code

texts:
I am trying to create products programmatically. In the task, I need to set the multiselect attribute options. I tried like below, but it is not working.

$optionIds[] = $optionId; //$optionIds = array(41,42,43)
$product->setData($attributeCode, $optionIds);

But it is not working. I don't know what I am doing wrong. Can anyone help on this?


texts: site admin viewing other sites customers

texts:
I have a multisite that has three separate websites using the same product database, the problem I have is the separate admins all being able to view the whole customer database, which is not ideal.

How can we limit the admins view so they can only to view the customers relevant to their website.


texts: Site load without css after Migrating from one server to another

texts:
After migrating my magento site from one server to another, I encounter the following problem: the site loads, but without styles (css), it is as if it could not access the file.
here are the permissions I have on my files:


texts: How to get selected Allowed country list in Magento 2..?

texts:
I need to get the the Selected Allowed Countries in a phtml file..

How can i get that ?


texts: Magento 2.3 product Customer Group pricing not working in shopping cart

texts:
Magento 2.3 product's customer group pricing while adding the product to the cart. It shows the regular price of the product in the cart. The same issue is the special price.

Any help would be appreciated..!

Thanks in advance..!


texts:
I've just created a Magento2 module, here is the module.xml

<?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="Company_MyModule" setup_version="1.0.0.0"></module>
</config>

So nothing out of the ordinary. I also have a InstallSchema.php file and a InstallData.php file to add a custom attribute to Products, as well as the ResourceModel that goes along.

When I run php bin/magento setup:upgrade then module gets installed, the new table is created. But the module is also enabled by default in app/etc/config.php.

Is this the standard behaviour? If so, how can one prevent it?

PS : I'm working on a dev environment.


texts: MySQL ver. in Apache 2.4.18 on windows 10, does not meet Magento 2 basic requirments!

texts:
I have installed the latest Apache version 2.4.18. In order to install Magento 2.
MySQL version is 5.2.12, but Magento 2 needs at least MySQL 5.6.
By the way, I found many solutions for Ubuntu, CentOS, but I want to run it on Windows 10.


texts: Magento 2.3 Composer stuck while downloading https://repo.magento.com/packages.json

texts:
I have a problem since about 24 hours I guess.
When I try to download Magento 2 with composer I stuck after logging with my user-credentials. The credentials are ok, it pass and go through the next step: Downloading https://repo.magento.com/packages.json

Here it hangs up. Nothing happens anymore.

I checked if the link is down, but its active.
I use the composer -vvv command what gives me a detailed view about what composer is doing. Here it stucks.

I've searched the web but could not find this error anywhere.

Has anybody faced the same strange thing?

I appreciate your help.

Thank you and have a great day.

Timm


texts: Get current category name for new product and best seller widget

texts:
Want to display the category name for each product in new products widget and best sellers widget

I have tried this but not working

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$category = $objectManager->get('Magento\Framework\Registry')->registry('current_category');
echo $category->getname();


texts: Static Block Links in Wrong Position / Size

texts:
I have created a static block with the identifier top_menu and one with the identifier footer_links with different links than the previous block with the same identifier.

Why is the "Contact Us" link sitting lower than it should in the navigation bar, and why are the links "WHY CHOOSE US?", "FAQ" and "CONTACT US" sitting above row 2 (the existing links) at a smaller size without the hover property, when it should be in row 1 (to the left of the existing links)?

Please see images

Link to Store: https://cashino.kellyseye.com/


texts: Is it possible to Upgrade from Magento 2.3.5-p1 to Magento 2.4?

texts:
I am trying to upgrade from Magento 2.3.5-p1 to Magento 2.4.
I have server with PHP 7.4 and MariaDB 10.2 and when i am trying to upgrade via composer than i am facing below error

Please let us know the solution required to resolve above issue.
Thanks


texts: Difference in including css,js,google fonts in Magento 2.1.x and 2.2.x

texts: Magento 2.1.x and 2.2.x have different ways of including scripts


texts: Magento 1.9 - use regular price instead of special price in dynamic price bundles

texts:
I've been working on this for some time with no luck. Basically, what I want to do is change the way bundle pricing works in Magento 1.9 so that, for each of the individual products in a bundle product, it uses the regular price at all times, even when the simple product in the bundle has a special price.

So for example, when I have a bundle that contains a simple product with a regular price of $19.95, I want the dynamic price of the bundle to be calculated using the $19.95 even when I put the simple product on special for $15.00.

I identified getSelectionFinalTotalPrice in Mage_Bundle_Model_Product_Price as the most likely place to change the code, but it seems no matter what I do it always returns the simple product's special price.

This is the code in its unmodified state

public function getSelectionFinalTotalPrice($bundleProduct, $selectionProduct, $bundleQty, $selectionQty,
                                            $multiplyQty = true, $takeTierPrice = true)
{
    if (is_null($selectionQty)) {
        $selectionQty = $selectionProduct->getSelectionQty();
    }

    if ($bundleProduct->getPriceType() == self::PRICE_TYPE_DYNAMIC) {
        $price = $selectionProduct->getFinalPrice($takeTierPrice ? $selectionQty : 1);
    } else {
        if ($selectionProduct->getSelectionPriceType()) { // percent
            $product = clone $bundleProduct;
            $product->setFinalPrice($this->getPrice($product));
            Mage::dispatchEvent(
                'catalog_product_get_final_price',
                array('product' => $product, 'qty' => $bundleQty)
            );
            $price = $product->getData('final_price') * ($selectionProduct->getSelectionPriceValue() / 100);

        } else { // fixed
            $price = $selectionProduct->getSelectionPriceValue();
        }
    }

$price = $this->getLowestPrice($bundleProduct, $price, $bundleQty);

    if ($multiplyQty) {
        $price *= $selectionQty;
    }

    return $price;
}

It all looks fairly straightforward, especially for dynamic bundles - there's really only one price calculation. I tried commenting out the call to getLowestPrice but it still returned the same incorrect values.

I'm hoping someone might be able to help with some advice as to how to go about this, I've been tearing my hair out for weeks over this.


texts:
i am using magento 1.9 with neoshop theme, i am new to magento and i create a New Arrivals category that i need to include those products that is newly posted with pagination. another question is please let me know how to configure sales invoice format of magento.

thank you


texts: How to send email to customer abanded cart - every 30 min - email reminders - abandoned cart for every 30 minute

texts:
How to customize email reminder abandoned cart rule to trigger abandoned cart every 30 minutes in magento2.3
Reproduce -
Go to magento admin then marketting->Communications tab->Email Reminders
Then create a New rule like below image

In Conditions tab i want to update the rule as hours/minutes rather than days.?

so please assist me here


texts: Magento2 : how can I call my theme images

texts:
I am trying to convert some M1.9 emails to M2 and it currently calls the images from

<img src="{{skin url="images/logo_email.gif" _area='frontend'}}

I've tried

<img src="{{view url="images/logo_email.gif"}}

I have all the images in app/design/frontend/Vender/Theme/web/images. Is this the correct location?

It works if I pull from the media folder with <img src="{{media url="/wysiwyg/logo_email.gif"}}, but I would really like to know how to pull from the theme folder in M2. I think it's a permissions issue as I cannot pull up any image from there.


texts: Can't Have Separate Billing & Shipping Addresses

texts:
I am having quite a big issue and its starting to get ridiculous, I have had complaints from customers saying that they can't have separate billing and shipping addresses.

I have since tried to put through a test order and when you uncheck My billing and shipping address are the same tick box, enter the shipping address, hit update and then continue the order, all that happens is that I get an error message saying:

  Please check the shipping address information. the street is a
  required field. the city is a required field. the telephone is a
  required field.

Which to me makes absolutely no sense!

I am starting to give up on Magento because stuff like this is easily configurable in other CMS's


texts: Find path of Mage::helper on FTP-Server?

texts:
I can see the following function in my template's minicart.phtml:

<?php echo Mage::helper("ves_tempcp/framework")->getMinicartBlock(); ?>

But on the FTP I can not find the folders ves_tempcp/framework. Where do I have to look for the path Mage::helper is looking for?

Thanks!


texts: Magento 1.9: Product Price tables - how they work?

texts:
Magento has many tables for managing prices

It looks to me that:

in product/category pages the product prices are loaded from the catalog_product_flat tables.
in search pages the _idx table are used ( I think for price range filter).

Table with data

|                    Table                    |         Notes          |
|---------------------------------------------|------------------------|
| catalog_product_index_price                 | has data - main  table |
| catalog_product_index_price_idx             | has data               |
| catalog_product_index_price_tmp             | has data               |

Table without data

|                    Table                    |         Notes          |
|---------------------------------------------|------------------------|
| catalog_product_index_price_bundle_idx      | no data                |
| catalog_product_index_price_bundle_opt_idx  | no data                |
| catalog_product_index_price_bundle_opt_tmp  | no data                |
| catalog_product_index_price_bundle_sel_idx  | no data                |
| catalog_product_index_price_bundle_sel_tmp  | no data                |
| catalog_product_index_price_bundle_tmp      | no data                |
| catalog_product_index_price_cfg_opt_agr_idx | no data                |
| catalog_product_index_price_cfg_opt_agr_tmp | no data                |
| catalog_product_index_price_cfg_opt_idx     | no data                |
| catalog_product_index_price_cfg_opt_tmp     | no data                |
| catalog_product_index_price_downlod_idx     | no data                |
| catalog_product_index_price_downlod_tmp     | no data                |
| catalog_product_index_price_final_idx       | no data                |
| catalog_product_index_price_final_tmp       | no data                |
| catalog_product_index_price_opt_agr_idx     | no data                |
| catalog_product_index_price_opt_agr_tmp     | no data                |
| catalog_product_index_price_opt_idx         | no data                |
| catalog_product_index_price_opt_tmp         | no data                |

So it looks like there only 3 tables that have data:

catalog_product_index_price
catalog_product_index_price_idx
catalog_product_index_price_tmp

The only actual used table is catalog_product_index_price, layer navigation uses it to filter the products by price.
(see Mage_Catalog_Model_Resource_Layer_Filter_Price->_getPriceExpression())

Tables: catalog_product_index_price

| entity_id | customer_group_id | website_id | tax_class_id | price | final_price | min_price | max_price | tier_price | group_price |

It hosts all combinations of websites/customer group
My permutation math is not very good anyway suppose you have:

100.000 products
2 websites ( an the price attribute scope set to Website )
10 customer groups

  => 100.000 * 2 * 10 = 2.000.000 rows

If you don't use different prices for different customer groups you end up waisting a lot of space on DB and the price reindex gonna be very slow.
(Because basically all 20 rows for each products will contain the same values )

Questions:

It is safe to delete all the above empty tables ?
Why there are 3 table catalog_product_index_price with data but only 1 is actually used ?

Optimization:

It would be possible to reduce the amount of rows in the index table in case the product prices are all the same for all the combinations ?


texts: Get products count in magento 2 list page before category description display

texts:
I need to display the products count at list page before category description.but its not working. Can you please anyone help me.

/vendor/magento/module-catalog/Block/Product/ListProduct.php

protected function _beforeToHtml()
    {
   $count_products = count($this->_productCollection);
            $this->_coreRegistry->register('productsCount',$count_products);
}

/app/design/frontend/Dcw/wps/Magento_Catalog/templates/category

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $registryObj = $objectManager->get('Magento\Framework\Registry');
 echo $productCount = $registryObj->registry('productsCount');


texts: Is it possible to override vendor/magento/module-sales/Api/Data/OrderAddressInterface.php as I want to get sales order address custom column value in order REST API.


texts:
I am on Magento 2.1 and I have looked all over and cannot find how to accomplish what I'm looking for. I've followed a few guides (http://inchoo.net/magento-2/how-to-create-a-basic-module-in-magento-2/ etc) on how to create basic controllers and I have accomplished that. But I am trying to make a controller which brings me to a list of all my brands in my store, and then when clicking one of the brands it brings me to a page with all of the materials for that brand.

Currently I have a module with the following structure:

Brands
  Block
     Brand.php
     Brands.php
  Controller
     Brand
        Index.php
     Index
        Index.php
  etc
     frontend
        routes.xml
     module.xml
  view
     frontend
        layout
           brands_brand_index.xml
           brands_index_index.xml
        templates
           brand.phtml
           brands.phtml
  registration.php

Currently when I go to mydomain/brands or mydomain/brands/index/index, it works as expected (bringing up a list of all brands). The same is true for mydomain/brands/brand or mydomain/brands/brand/index.

My question is, how to I get my controller to work for something like mydomain/brands/brand/12345 or something like that? When I try this currently, it says 404 error message.

Thanks in advance!


texts:
I have tried to change the default logo but I get greeted with the small blue box with a question mark in. I have uploaded it to the right place and I have changed the design option in Config but it won't have any. I have tried it again with the default logo and it works fine, just not with custom logos. Its a PNG if that helps, but I read that it doesn't matter what the format whether it be PNG or GIF.

Thanks,


texts: Get redirected to our payment gateway page in magento 2

texts:
I want to make a Payment Gateway on magento 2 and I developed a Model. By this I want to get all values from magento 2 and post it our payment gateway means I want to redirect it please suggest me the code is below

namespace Xyz\Abc\Model;
class XyzPaymentMethod extends \Magento\Payment\Model\Method\AbstractMethod
{
    protected $_code = 'xyzpaymentmethod';

    protected $_isOffline = false;

    public function capture(\Magento\Payment\Model\InfoInterface $payment, $amount)
    {
        echo '<pre>';

        print_r($payment);
        print_r($amount);

        exit();
    }

}


texts: how do i log in form on magento2.3 home page

texts: I created a login form on the home page of the magento website but I don't know how to make it work


texts: Magento2 - Adminhtml - Checkboxes default as checked when it does not show as checked

texts:
I am a bit of a lost as to handling checkboxes (a group of them) for a custom form, made as a UI Component.

On the form, they look as if they are unchecked, but if I click them then it reacts normally, but the "Pencil" indicator does not show up on the tab button on the left of the admin page until I unchecked the checkbox that it shows this part of the form has been changed. Furthermore, if I submit the form without changing the checkboxes then the POST data shows they are checked with their correct values. It is only when I "check" then "uncheck" the boxes that the POST value does NOT include the fields.Please reply me if anyone know.

Vendor/Module/view/adminhtml/ui_component/location_listing.xml

<fieldset name="features">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="label" xsi:type="string" translate="true">Features</item>
        </item>
    </argument>

    <field name="feature_discovery">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string">Discovery Center</item>
                <item name="visible" xsi:type="boolean">true</item>
                <item name="dataType" xsi:type="string">text</item>
                <item name="formElement" xsi:type="string">checkbox</item>
                <item name="value" xsi:type="number">1</item>
                <item name="checked" xsi:type="boolean">false</item>
                <item name="source" xsi:type="string">features</item>
            </item>
        </argument>
    </field>

    <field name="feature_classes">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string">Classes</item>
                <item name="visible" xsi:type="boolean">true</item>
                <item name="dataType" xsi:type="string">text</item>
                <item name="formElement" xsi:type="string">checkbox</item>
                <item name="value" xsi:type="number">2</item>
                <item name="checked" xsi:type="boolean">false</item>
                <item name="source" xsi:type="string">features</item>
            </item>
        </argument>
    </field>

    <field name="feature_outlet">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string">Outlet Center</item>
                <item name="visible" xsi:type="boolean">true</item>
                <item name="dataType" xsi:type="string">text</item>
                <item name="formElement" xsi:type="string">checkbox</item>
                <item name="value" xsi:type="number">3</item>
                <item name="checked" xsi:type="boolean">false</item>
                <item name="source" xsi:type="string">features</item>
            </item>
        </argument>
    </field>
</fieldset>


texts: Magento is not installing in localhost(windows): SQLSTATE[42S01]: Base table or view already exists:

texts:
I was a regular user of magento 1 month before but now i found difficult to install the magento.
Magento is not installing in localhost neither in XAMPP nor in WAMP all the versions and keep on showing the following error:

There has been an error processing your request

Exception printing is disabled by default for security reasons.

Error log record number: 142520047

I have tried all the setting options that are present on all the support forums.
Please someone help me in finding the solution.

These are the errors in report

a:5:{i:0;s:193:"Error in file: "C:\wamp\www\magento\app\code\core\Mage\Api2\sql\api2_setup\install-1.0.0.0.php" - SQLSTATE[42S01]: Base table or view already exists: 1050 La table 'api2_acl_role' existe déjà";i:1;s:912:"#0 C:\wamp\www\magento\app\code\core\Mage\Core\Model\Resource\Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...')
#1 C:\wamp\www\magento\app\code\core\Mage\Core\Model\Resource\Setup.php(421): Mage_Core_Model_Resource_Setup->_modifyResourceDb('install', '', '1.0.0.0')
#2 C:\wamp\www\magento\app\code\core\Mage\Core\Model\Resource\Setup.php(327): Mage_Core_Model_Resource_Setup->_installResourceDb('1.0.0.0')
#3 C:\wamp\www\magento\app\code\core\Mage\Core\Model\Resource\Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 C:\wamp\www\magento\app\code\core\Mage\Core\Model\App.php(417): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 C:\wamp\www\magento\app\code\core\Mage\Core\Model\App.php(343): Mage_Core_Model_App->_initModules()
#6 C:\wamp\www\magento\app\Mage.php(683): Mage_Core_Model_App->run(Array)
#7 C:\wamp\www\magento\index.php(87): Mage::run('', 'store')
#8 {main}";s:3:"url";s:44:"/magento/index.php/install/wizard/installDb/";s:11:"script_name";s:18:"/magento/index.php";s:4:"skin";s:7:"default";}


texts:
I am using Magento 2.3

when I create new category and check url_rewrite and front end that url generate like this domain.com/parent.html/subcategory.html

instead I need url like domain.com/parent/subcategory.html

yes I can edit in url_rewrite by manually. I want to solve it permanent

It is strange while in local setup Magento2.3 its working fine.

any idea. why this happen?

Please check my store->config->catalog->SEO setings below


texts: How to get order total including Shipping and Tax cost

texts:
I am trying to get the cart total on checkkout_cart_index by using the below code. But this code is returning cart total without Shipping and Tax.
How can I get the total including Shipping Cost and Tax?
define([
'ko',
'uiComponent',
'mage/url',
'mage/storage',
'Magento_Checkout/js/model/quote',
],function (ko, Component, urlBuilder,storage,quote)
{
    'use strict';
    return Component.extend({
        defaults: {template: 'Ishaq_CheckoutTotal/custom-block-order-summary',},
        initialize: function(config) {
            this._super();

        },
        getGrandTotal: function() {
            var totals = quote.totals();
            return (totals ? totals : quote)['grand_total'] ;
        }
    });
});


texts: Magento 2 Filtering a Product Collection in a CMS Page

texts:
I'm trying to pull a product collection into a CMS page based on an attribute. I have the collection pulled in and I can return the SKU and URL of the product in my loop, but the product name returns null. Am i loading this collection in correctly? Is there a better way to go about doing this.

Here is my block:

namespace {{vendor}}\ManufacturerPages\Block;

class Manufacturer extends \Magento\Framework\View\Element\Template {
    protected $categoryFactory;

    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
        \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility,
        array $data = []
    ){
        $this->_productCollectionFactory = $productCollectionFactory;
        $this->_catalogProductVisibility = $catalogProductVisibility;
        parent::__construct($context, $data);
    }

    public function getProductCollection() {
        $attrId = $this->getAttrId();
        $collection = $this->_productCollectionFactory->create();
        $collection->setVisibility($this->_catalogProductVisibility->getVisibleInCatalogIds());
        $collection->addAttributeToFilter('manufacturer', ['eq' => $attrId]);

        return $collection;
    }
}

This is the code in the template:

$productCollection = $this->getProductCollection();

foreach ($productCollection as $product) {
    var_dump(($product->getData('name')));
    var_dump(($product->getId()));
    var_dump(($product->getProductUrl()));
    var_dump(($product->getSku()));
}

And i'm calling in template and block in the cms page with this line:

{{block class="{{vendor}}\ManufacturerPages\Block\Manufacturer"  attr_id="2337" template="{{vendor}}_ManufacturerPages::manufacturers/pages.phtml"}}

In case anyone is already thinking this, the cms page widget that will pull in a product list is no longer working on the site i'm building. I have found a github post about the issue being corrected in v2.1, but of reasons out of my control I wont be able to update the site before it goes live. So I'm trying to find a work around.


texts: CSV Import: How can I import related products in Magento 2?

texts:
How can I import related products via csv in Magento 2?

In my csv file I have a row with attribute related_skus with example data "11-111,22-222" for a product. But in admin Products->Catalog in this imported product the sidebar tab Related Products show no products although those products with skus exist in catalog.

Where can be the mistake?


texts:
I'm installing a new version of magento 2x my issue is that I'm getting this error:

  php-pdo-mysql-version-minimum v1 (detected: OFF)

on install, I'm using php7.0 and i checked PDO and it's on, any idea what else is causing this?


texts: index management on Magento2, update by schedule, not working...?

texts:
My setting for index management is currently update by schedule, as somehow Update on save seems to be not working.

I have saved a configurable product with correct stock setting, however, it appears as out of stock. And the last stock index apppears as Jan 19, 2017, 2:39:05 PM (now is Jan 21, 2017, 8:43 AM).

Is something wrong with my setting??
My magento is ver. 2.1.3.

My cron settings are as follows.

/usr/local/bin/php /magento/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /magento/var/log/magento.cron.log

/usr/local/bin/php /magento/update/cron.php >> /magento/var/log/update.cron.log

/usr/local/bin/php /magento/bin/magento setup:cron:run >> /magento/var/log/setup.cron.log


texts: Magento 2 How to remove phone column in customer grid programmatically

texts:
in customer grid there is a phone column like this:

i can filter this column or choose to hide/show this column from setting, i need to remove this phone column from grid and filter, is there a way to do this programmatically from custom module?


texts: How to show grand total of wishlist item list incluging tax?

texts:
I wants to show grand total including tax. i have follow this link to show grand total without tax how to get Grand Total of Wishlish Items in magento? and it working fine. but i need to display grand total of wishlist item including tax. please help.

This is my list.phtml file

<?php
$columns = $this->getColumns();
$wishListTotal = 0;
?>

    <?php
        /* @var $column  Mage_Wishlist_Block_Customer_Wishlist_Item_Column */
        foreach ($columns as $column):
            $_blockName = str_replace('.','-',strtolower($column->getNameInLayout()));
    ?>
        <th class="<?php echo $_blockName; ?>"><?php echo $column->getTitle();?>
    <?php endforeach; ?>

<?php if (count($this->getItems())): ?>
    <?php foreach ($this->getItems() as $item):
                $_product = $item->getProduct();
                $_priceIncludingTax = Mage::helper('tax')->getPrice($_product, $_product->getFinalPrice());
                $wishListTotal += $item->getQty() * $_priceIncludingTax;?>
        <tr id="item_<?php echo $item->getId();?>">
            <?php
                foreach ($columns as $key => $column):
                    $_blockName = str_replace('.','-',strtolower($column->getNameInLayout()));

                    /* Override default column title in layout, useful for certain cases like select all box */
                    if ($column->getRwdTitle()) {
                        $_rwdLabel = $column->getRwdTitle();
                    } else {
                        $_rwdLabel = ($column->getTitle()) ? $column->getTitle() : false;
                    }
            ?>
                <td class="<?php echo 'wishlist-cell'.$key; ?> <?php echo $_blockName; ?>"<?php if($_rwdLabel): ?> data-rwd-label="<?php echo $_rwdLabel; ?>"<?php endif; ?>><?php $column->setItem($item); echo $column->toHtml($item);?>
            <?php endforeach; ?>

    <?php endforeach ?>
    <?php else: ?>
    <td colspan="<?php echo count($columns);?>" class="wishlist-empty"><?php echo $this->__('This quote has no Items');?>
    <?php endif; ?>

    <?php echo $this->__("Grand Total");?>
    <?php echo Mage::helper('core')->currency($wishListTotal, true, false); ?>
    &nbsp;

  <?php foreach ($columns as $column): ?>
  <?php echo $column->getAdditionalHtml();?>
 <?php endforeach; ?>

updated
This is my wishlist frontend view


texts: How to force a admin user to change their password?

texts:
On Magento EE if you go to System > Configuration > Advanced > Admin > Security their is an option to set Password Change to Forced.

If we do this and someone has an expired password will it lock them out - or will it allow them login but force them to update their password?

I've tried looking through the Magento User Guide & Wiki but could find no answer :(


texts: How to move category filters in layered navigation after the attribute filters

texts:
Is there any method by which we can move the category filters after the attribute filters in layered navigation using layout config files

Searching i reached this question in stackoverflow

But i want to know whether it is possible with layout xml files OR
Alter the order of occurrence in layer\view.phtml ( is this not at all a good idea?)


texts: How to insert the cms page content inside a block?

texts:
How can I show the home page cms content inside a block? For instance, I have this content in my cms home page,

welcome to my home page.

And I want to insert this content inside a block called 'carousel',

this is my page.xml,

<default translate="label" module="page">
    All Pages
    <block type="page/html" name="root" output="toHtml" template="page/3columns.phtml">
        <block type="core/template" name="carousel" as="carousel" template="page/html/carousel.phtml">
            Bootstrap Carousel
            <block type="core/text_list" name="content" as="content" translate="label">
                Main Content Area
            </block>
        </block>
</default>

And this is my local.xml,

   <reference name="carousel">
        <block type="cms/block" name="cms_page_content">
            <action method="setBlockId">
                <block_id>cms_page_content</block_id>
            </action>
        </block>
    </reference>

Nothing is being printed out.

Any ideas?

EDIT:

Using a static block,

local.xml,

<reference name="carousel">
            <block type="cms/block" name="carouselx" before="carousel.content">
                <action method="setBlockId">
                    <block_id>carousel</block_id>
                </action>
            </block>
        </reference>


texts: How to create a new product type in magento2

texts:
I have created new product type in magento2 using https://www.classyllama.com/blog/custom-product-types-magento-2.

After the i can't see any product info in view page.. It only display the Images tab in view page..

product_type.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/product_types.xsd">
    <type name="custom_product_type_code" label="Custom Product Type Label" modelInstance="XXX\CustomiseProductInfo\Model\Product\Type" indexPriority="60" sortOrder="80" isQty="true">
    </type>
</config>

Type.php

class Type extends \Magento\Catalog\Model\Product\Type\AbstractType
{
    const TYPE_ID = 'custom_product_type_code';

    /**
     * {@inheritdoc}
     */
    public function deleteTypeSpecificData(\Magento\Catalog\Model\Product $product)
    {
        // method intentionally empty
    }
}


texts: Magento 2 An error occurred on the server. Please try to place the order again

texts:
I know my question are like this

But in my case when I check errors I see this

  Magento\Customer\Model\Customer\Interceptor::_getResource","trace":"#0 /backup/html/toph/vendor/magento/framework/Interception/Interceptor.php(146): Magento\Checkout\Model\PaymentInformationManagement->savePaymentInformationAndPlaceOrder(151, Object(Magento\Quote\Model\Quote\Payment), Object(Magento\Quote\Model\Quote\Address))\n#1 /backup/html/toph/var/generation/Magento/Checkout/Model/PaymentInformationManagement/Interceptor.php(26):

I remove var/generation and re compile my code and set permission to file but error does not fixed .


texts: Where to change link in checkout payment information tab. Enterprise 1.13.1.0

texts:
There is one line within the checkout process under Payment Information that says: "To add or remove gift cards, click here."

I literally just need to change the wording of this and possibly the styling. But I cannot find anywhere that it would be. I assumed it would be in the template files but everywhere I've looked came up empty.

Any help is appreciated - Thanks!


texts: When clearing cache I have to restart Varnish to see changes

texts:
I am new to optimizing and maintaining Magento 2.2. I have an installation that are setup with:

Dedicated server
Ubuntu 16.04
Nginx
PHP 7
MySQL 5.7
Magento 2.2
memcached
Redis
Varnish 4

I am confused about a couple of things regarding indexing, cache & varnish and I am sorry if my questions seems stupid/weird:

It seems when I make some changes i have to clear the cache in the admin and restart Varnish (service nginx restart) from the shell for the changes to be shown in the front-end. Is it supposed to be like this or can I somehow link restart of varnish with clearing of cache? Or is there something I am missing?
After restart of Varnish it seems there are a "warm up" time period as customers visits the pages. I there anyway to pre-warm up varnish/cache?
Prices changes frequently everyday for a lot of products and it seems that I have to re-index (and clear cache + restarting varnish) often for those prices to be shown in the front-end. Problem is the prices index takes +45 minutes and apparently makes the front-end unavaliable. The question is if there are a better way to achieve the same result?


texts: Where is this text coming from at the end of my checkout URL?

texts:
I'm adding a "buy now" button to my site.  I'm using the code from here.

When I click the button, my site tries to go to example.com/checkout/#93=4, which then results in it going to example.com/checkout/noroute.  Where is the #93=4 part coming from?  I've tried to step through the Magento code in a debugger, and as far as I can tell, the extension is trying to go to example.com/checkout/, and I can't figure out what's adding the #93=4.  But I'll be honest; I don't understand Magento's routing.

Here are the parts of the code that I think are relevant:

buynow.js

define([
    'jquery'
], function ($) {
    "use strict";
    return function (config, element) {
        $(element).click(function () {
            var form = $(config.form);
            var baseUrl = form.attr('action'),
            buyNowUrl = baseUrl.replace('checkout/cart/add', 'buynow/cart/add');
            form.attr('action', buyNowUrl);
            form.trigger('submit');
            form.attr('action', baseUrl);
            return false;
        });
    }
});

Add.php

I've used the debugger to verify that the line $baseUrl = $this->_objectManager->get('\Magento\Store\Model\StoreManagerInterface')->getStore()->getBaseUrl(); towards the bottom of the code does return example.com/checkout/ (no #93=4)

class Add extends \Magento\Checkout\Controller\Cart\Add
{
    /**
     * Add product to shopping cart action
     *
     * @return \Magento\Framework\Controller\Result\Redirect
     * @SuppressWarnings(PHPMD.CyclomaticComplexity)
     */
    public function execute()
    {
        if (!$this->_formKeyValidator->validate($this->getRequest())) {
            return $this->resultRedirectFactory->create()->setPath('*/*/');
        }

        $params = $this->getRequest()->getParams();
        try {
            if (isset($params['qty'])) {
                $filter = new \Zend_Filter_LocalizedToNormalized(
                    ['locale' => $this->_objectManager->get('Magento\Framework\Locale\ResolverInterface')->getLocale()]
                );
                $params['qty'] = $filter->filter($params['qty']);
            }

            $product = $this->_initProduct();
            $related = $this->getRequest()->getParam('related_product');

            if (!$product) {
                return $this->goBack();
            }

            $cartProducts = $this->_objectManager->create('Test\BuyNowButton2\Helper\Data')
                             ->getConfig('buynow/general/keep_cart_products');
            if (!$cartProducts) {
                $this->cart->truncate(); //remove all products from cart
            }

            $this->cart->addProduct($product, $params);
            if (!empty($related)) {
                $this->cart->addProductsByIds(explode(',', $related));
            }

            $this->cart->save();
            $this->_eventManager->dispatch(
                'checkout_cart_add_product_complete',
                ['product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse()]
            );

            if (!$this->_checkoutSession->getNoCartRedirect(true)) {
                $baseUrl = $this->_objectManager->get('\Magento\Store\Model\StoreManagerInterface')
                            ->getStore()->getBaseUrl();
                return $this->goBack($baseUrl.'checkout/', $product);
            }
        } catch (\Exception $e) {
            // ...
        }
    }
}


texts:
I'm trying to pull through the gallery images on the product page as I'm re doing the gallery. The code I'm using is:

<?php $_product = $block->getProduct(); ?>
<?php $gallery = $_product->getMediaGalleryImages(); ?>

<?php foreach ($gallery as $galleries): ?>
  <figure><?php echo $galleries ?></figure>
<?php endforeach; ?>

But this throughs back an error of "Object can't be converted to string"

Any ideas on how to fix this?


texts: Pages in different languages not updating

texts:
I have created an homepage for the 2 languages (es/en) my site is built in, however, despite the Page Information /content/ design etc being identical, the en version will simply not display the same content as the es.

Any tips as how to fix it please?


texts:
Is there documentation anywhere for the email template syntax, specifically the available |[filter] options available for formatting values for display in an email?

I see in some of the example emails that they use a syntax of {{ var someVariable |raw }} -- what I'm looking for are what the things are after the '|' that are available, how I might add more and/or what the syntax (and code location) of those might be.


texts:
$collection = Mage::getModel('cms/block')->getCollection();

The above collection brings cms block table fields. How to add filter in these collections.


texts:
I'm getting this error in my store:

Invalid XML in file /Library/WebServer/Documents/Magento/app/design/frontend/vendor/vendor_theme/etc/view.xml:
Element 'theme': No matching global declaration available for the validation root.
Line: 2

My code

<?xml version="1.0" encoding="UTF-8"?>
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
     &#60;title&#62;Vendor&#60;/title&#62;
     &#60;parent&#62;Magento/blank&#60;/parent&#62;
 &#60;/theme&#62;

I've run this through xml check sites. It's valid according to them and my knowledge of XML.

I'm new to this framework. Thanks.


texts: Category sidebar width in the category admin panel

texts: Is there any way to widen the category sidebar on the manage categories page in the admin panel? My subcategory names are too long to display fully and with each additional sub level, less and less of the name is visible. Because many of my subcategory names start the same with only the last word being different, it makes it very hard to manage the subcategories without seeing the full name. Thanks!


texts:
I will appreciate any advices.
I had a processing order (buyer bought via ebay) and was marked complete as the item has been sent. Buyer then open ebay dispute and we have refunded them.

After refund, my Magento automatically marked the invoice/sale record as processing again and im not able to cancel or issue credit memo on it.
On the invoice page, it is only showing the following tabs
back, edit, send email, hold, reorder.

Can anyone please advise me what should i do to cancel this order.


texts: I changed the baseurl system->configuration->web from mysite.com to mysite.com/mysite trying to fix an error.  Problem is now i can't get into the backend to change it back.  Does someone know a fix for this without backend access?


texts: Add Javascript globally in Magento 2 backend

texts: I have a custom extension that has a javascript file which need to run on every page in magento 2 backend to use jquery and ajax function, is there a way to do this action with custom extension?


texts:
I wrote a custom api for magento 2.3.1

When i call the endpoint that i was created i get the following error

{
"messages": {
    "error": [
        {
            "code": 500,
            "message": "Server internal error. See details in report api/1560842508114"
        }
    ]
}
}

Report detail:

  "Fatal Error: 'Uncaught Error: Cannot instantiate interface Demo\Hello\Api\HelloInterface in /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:116\nStack trace:\n#0 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Demo\\Hello\\Api\\...', Array)\n#1 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Compiled->create('Demo\\Hello\\Api\\...')\n#2 /var/www/html/vendor/magento/module-webapi/Controller/Rest/SynchronousRequestProcessor.php(90): Magento\Framework\ObjectManager\ObjectManager->get('Demo\\Hello\\Api\\...')\n#3 /var/www/html/vendor/magento/module-webapi/Controller/Rest.php(188): Magento\Webapi\Controller\Rest\SynchronousRequestProcessor->process(Object(Magento\Framework\Webapi\Rest\Request\Proxy))\n#4 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Fr' in '/var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php' on line 116"

  app/code/Demo/Hello/registration.php

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Demo_Hello',
__DIR__
);

  app/code/Demo/Hello/Api/HelloInterface.php

<?php
namespace Demo\Hello\Api;
interface HelloInterface
{
   /**
   * Returns greeting message to user
   *
   * @api
   * @param string $name Users name.
   * @return string Greeting message with users name.
   */
   public function name($name);
}

  app/code/Demo/Hello/etc/di.xml

    <?xml version="1.0"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Demo\Hello\Api\HelloInterface"
                type="Demo\Hello\Model\Hello" />
</config>

  app/code/Demo/Hello/Model/Hello.php

<?php
namespace Demo\Hello\Model;
use Demo\Hello\Api\HelloInterface;
class Hello implements HelloInterface
{
   /**
   * Returns greeting message to user
   *
   * @api
   * @param string $name Users name.
   * @return string Greeting message with users name.
   */
   public function name($name) {
      return "Hello, " . $name;
   }
}


texts: Add WYSIWYG Editor to Block Form in Magento 2

texts:
How do you add a WYSIWYG editor to a custom form which you create through a block? I have found this article for doing this through UI components but need this for a block.
I've tried the following:
$fieldset->addField(
            'content',
            'editor',
            [
                'name' => 'content',
                'label' => __('Body'),
                'title' => __('Body'),
                'rows' => '5',
                'cols' => '30',
                'wysiwyg' => true,
                'required' => true
            ]
        );


texts: Magento access magento session from outside same domain

texts:
I need to access magento session from outside but same domain.

domain: example.com

I need to access from: example.com/test

I used this code. But its not giving correct output even I logged to magento.

        require_once ($_SERVER["DOCUMENT_ROOT"]."/app/Mage.php");
        Mage::app();
        define('ROOT', Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB));
        $coreSession = Mage::getSingleton('core/session', array('name' => 'frontend'));
            $customerId = $coreSession['visitor_data']['customer_id'];
        Mage::getSingleton('customer/session')->loginById($customerId);
        $customerSession = Mage::getSingleton("customer/session");
        $customer = $customerSession->getCustomer();
        $telefono = $customer->getTelefonoMovil();
        var_dump($customer);


texts:
I am trying to get my system config values and so far compared to M1 it's been very frustrating.
I am following this tutorial.

Everything works fine, but as soon as I want to call the values with:

$this->scopeConfig->getValue('helloworld/general/enable', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);

I get a

Notice: Undefined property:Mageplaza\HelloWorld\Controller\Index\Test\Interceptor::$scopeConfig


texts: How to custom fields add while fetch V1/invoices API in magento2?

texts:
I have tried to add custom fields but I am not able to add it.
I have already extended "magento-sales" default module also routes set but not able to add some fields like "billing_address".

Thanks,

Advance


texts: What's the purpose of the unique index on 'value' in 'catalog_product_entity_url_key'?

texts:
We're on a heavily modified EE 1.13.0.2 with some 20 store views - some of them sharing the same language - facing a problem with url keys.

These are generated and differ per language BUT this doesn't work reliably because of the unique index on the value column in catalog_product_entity_url_key. The unique constraint prevents duplicated url keys even if they belong to different store views.

As a result it seems impossible to have both of these links in the same magento installation:

http://store1.example.com/product.html
http://store2.example.com/product.html

Seems like in previous versions the index spanned (store_id, value) but was changed to value only. Can anyone explain why this has changed? Btw: catalog_category_entity_url_key doesn't have any index on its value column.

Is it safe to change the index back to (store_id, value)? Would I have to change other tables as well (e.g. tmp or index ones)?
Any other suggestion on how to work around this?

UPDATE
Other URL-related tables (*_url_rewrite_*) all seem to include the store_id in their unique indices so this observed abnormality is getting even weirder.


texts: Configurable Product Values Error : If select Drop-Down values price change to "0"

texts: I have set configurable products, if i select products selection its show "0",


texts: How to render HTML with AJAX in Magento 2

texts:
I try to find the best way to render HTML through AJAX in Magento 2.

Way 1 : Using Controller without layout

File Foo/Bar/Controller/Popin/Content.php

<?php

namespace Foo\Bar\Controller\Popin;

use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;

/**
 * Class Content
 */
class Content extends Action
{

    /**
     * Content constructor.
     *
     * @param Context $context
     */
    public function __construct(
        Context $context
    ) {
        parent::__construct($context);
    }

    /**
     *
     */
    public function execute()
    {
        /** @var \Magento\Framework\View\Layout $layout */
        $layout = $this->_view->getLayout();

        /** @var \Foo\Bar\Block\Popin\Content $block */
        $block = $layout->createBlock(\Foo\Bar\Block\Popin\Content::class);
        $block->setTemplate('Foo_Bar::popin/content.phtml');

        $this->getResponse()->setBody($block->toHtml());
    }
}

Way 2 : Using Controller with custom layout

File Foo/Bar/Controller/Popin/Content.php

<?php

namespace Foo\Bar\Controller\Popin;

use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;

/**
 * Class Content
 */
class Content extends Action
{

    /**
     * Content constructor.
     *
     * @param Context $context
     */
    public function __construct(
        Context $context
    ) {
        parent::__construct($context);
    }

    /**
     *
     */
    public function execute()
    {
        $this->_view->loadLayout();
        $this->_view->renderLayout();
    }
}

File Foo/Bar/view/frontend/page_layout/ajax-empty.xml

<?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">
    <container name="root"/>
</layout>

File Foo/Bar/view/frontend/layout/foo_bar_popin_content.xml

<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="ajax-empty" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="root">
            <block class="Foo\Bar\Block\Popin\Content" name="foo_bar_popin_content" template="Foo_Bar::popin/content.phtml" cacheable="false"/>
        </referenceContainer>
    </body>
</page>

IMO the best practice seems to be the Way 2 because it separate the logic from the Controller.
But the issue with the Way 2 is that the <body> and <head> with CSS / JS are generated so it is not a full cleaned HTML with only my block template in it.

am I using the custom layout the wrong way ?
Is the Way 1 is considered as a good practice ?
Are there any others ways to do that ?


texts: Order object not display under checkout_submit_all_after observer

texts:
Created event:

<event name="checkout_submit_all_after">
    <observer name="iversa_runningbox_shipment_checkout_submit_all_after" instance="Iversa\RunningboxShipment\Observer\CheckoutAllSubmitAfterObserver"/>
</event>

And observer code:

public function execute(\Magento\Framework\Event\Observer $observer)
{
  $order = $observer->getEvent()->getOrder();
  $order_id = $order->getIncrementId();
  file_put_contents('checkouttest.txt', print_r($order_id,true), FILE_APPEND);//This value is showing in log file
  file_put_contents('checkouttest.txt', print_r($order,true), FILE_APPEND);//This value is NOT showing in log file
  file_put_contents('checkouttest.txt', print_r($order->getAllItems(),true), FILE_APPEND);//This value is NOT showing in log file
}

Order object and get all product items is not showing result


texts:
i want to completely remove from cache the header-minicart.
It is confused when magento cache and fpc work together.

how can i do that?


texts: system.xml conflicts if added more than one time

texts:
In my project more than one system.xml a file is used for constant variables. I added one field in system.xml but it displays other module's field with the one I added.

<?xml version="1.0"?>
<config>
   <tabs>
     <myconf1 translate="label">
        Exotel API
        <sort_order>185</sort_order>
     </myconf1>
   </tabs>
   <sections>
     <tab1 translate="label" module="adminhtml">
        Call Us
        <tab>myconf1</tab>
        <sort_order>186</sort_order>
        <show_in_default>1</show_in_default>
        <show_in_website>1</show_in_website>
        <show_in_store>1</show_in_store>
        <groups>
            <general1 translate="label comment">
                General
                <sort_order>187</sort_order>
                <show_in_default>1</show_in_default>
                <show_in_website>1</show_in_website>
                <show_in_store>1</show_in_store>

                <fields>
                    <text_field translate="label comment">
                        Mobile No.
                        <frontend_type>text</frontend_type>
                        <sort_order>188</sort_order>
                        <show_in_default>1</show_in_default>
                        <show_in_website>1</show_in_website>
                        <show_in_store>1</show_in_store>
                    </text_field>
                </fields>
            </general1>
        </groups>
    </tab1>
  </sections>
</config>

How to avoid conflict?


texts: Where inside module to save single for of single field?

texts: I need to save a date of last imported data. This is one single row of single field. Is there any other way or do I need only for this single row and field create new table?


texts:
Magento has a built in frontend rss feed for customer orders via /rss/sales/orders that is blocked via page auth which seems open to brute force attacks?

Also if I was to use the same function for access via frontend to fetch other system data ( customers list etc)

Is this good practice to have frontend single login access for this output given that the magento latform has this type as default?